Skip to content

Commit

Permalink
publish frontend to github pages
Browse files Browse the repository at this point in the history
  • Loading branch information
Adam McKee committed Jun 2, 2024
1 parent c4b9b3f commit a278bb8
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 5 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/www.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Deploy frontend from main

on:
workflow_dispatch:

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

concurrency:
group: "pages"
cancel-in-progress: false

jobs:
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- name: Build
run: |
corepack enable && corepack prepare pnpm@latest --activate
pnpm i
pnpm build
working-directory: frontend
- name: Setup Pages
uses: actions/configure-pages@v4
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: 'frontend/dist'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
10 changes: 5 additions & 5 deletions frontend/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ docker run -i --rm 84tech/minhtml \
< dist/original.html \
> dist/index.html

rm dist/original.html
#rm dist/original.html

brotli -o dist/index.html.br dist/index.html
find dist/assets -type f -maxdepth 1 \( -iname \*.css -o -iname \*.js \) -exec brotli -o {}.br {} ';'
#brotli -o dist/index.html.br dist/index.html
#find dist/assets -type f -maxdepth 1 \( -iname \*.css -o -iname \*.js \) -exec brotli -o {}.br {} ';'

gzip -S .gz -k dist/index.html
find dist/assets -type f -maxdepth 1 \( -iname \*.css -o -iname \*.js \) -exec gzip -S .gz -k {} ';'
#gzip -S .gz -k dist/index.html
#find dist/assets -type f -maxdepth 1 \( -iname \*.css -o -iname \*.js \) -exec gzip -S .gz -k {} ';'

0 comments on commit a278bb8

Please sign in to comment.