Skip to content

Commit

Permalink
feat: update favicon, og and add demo site workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Th1nkK1D committed Jun 25, 2024
1 parent 9765085 commit 86d4990
Show file tree
Hide file tree
Showing 7 changed files with 69 additions and 12 deletions.
62 changes: 62 additions & 0 deletions .github/workflows/demo.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Build Demo Campaign Website

on:
push:
branches: ['main']
paths-ignore:
- '**/README.md'
- '**/*.d.ts'
- 'src/scripts/**'
# schedule:
# - cron: "0 0 * * *" # Trigger every 00:00 GMT
workflow_dispatch:

permissions:
contents: read
pages: write
id-token: write

concurrency:
group: 'demo'
cancel-in-progress: false

jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
- name: Setup Pages
id: pages
uses: actions/configure-pages@v5
- name: Install dependencies
run: npm i
- name: Build with Astro
run: npm run build
env:
DEMO_MODE: true
PUBLIC_FIREBASE_CONFIG: ${{ secrets.PUBLIC_FIREBASE_CONFIG }}
ADMIN_EMAIL: ${{ secrets.ADMIN_EMAIL }}
ADMIN_PASSWORD: ${{ secrets.ADMIN_PASSWORD }}
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: dist

deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
needs: build
runs-on: ubuntu-latest
name: Deploy
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
4 changes: 2 additions & 2 deletions e-initiative.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ export default {
metadata: {
title: 'E-Initiative Template',
description: 'Customizable template for Thailand E-initiative',
siteUrl: 'https://e-initiative-template.pages.dev',
previewImageUrl: 'https://e-initiative-template.pages.dev/og.png',
siteUrl: 'https://wevisdemo.github.io/e-initiative-template',
previewImageUrl: 'https://wevisdemo.github.io/e-initiative-template/og.png',
},
petition: {
endDate: new Date('2024-10-10 GMT+7'),
Expand Down
Binary file added public/favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 0 additions & 9 deletions public/favicon.svg

This file was deleted.

Binary file added public/og.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/layouts/Body.astro
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const previewImageUrl =
<html lang="th">
<head>
<meta charset="utf-8" />
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
<link rel="icon" type="image/png" href="/favicon.png" />
<meta name="viewport" content="width=device-width" />
<meta name="generator" content={Astro.generator} />
<title>{title}</title>
Expand Down
4 changes: 4 additions & 0 deletions src/utils/firebase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ const getUser = (auth: Auth): Promise<User> => {
};

export const submitDocument = async (document: FormDocument) => {
if (getEnv('DEMO_MODE')) {
return new Promise<void>((res) => setTimeout(res, 2000));
}

await signInAnonymously(auth);
const user = await getUser(auth);

Expand Down

0 comments on commit 86d4990

Please sign in to comment.