From a278bb88592b420af432e25fb702de3f2a97edef Mon Sep 17 00:00:00 2001 From: Adam McKee Date: Sun, 2 Jun 2024 10:52:59 -0500 Subject: [PATCH] publish frontend to github pages --- .github/workflows/www.yml | 41 +++++++++++++++++++++++++++++++++++++++ frontend/build.sh | 10 +++++----- 2 files changed, 46 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/www.yml diff --git a/.github/workflows/www.yml b/.github/workflows/www.yml new file mode 100644 index 0000000..989d028 --- /dev/null +++ b/.github/workflows/www.yml @@ -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 diff --git a/frontend/build.sh b/frontend/build.sh index 0cf0275..cbd45df 100755 --- a/frontend/build.sh +++ b/frontend/build.sh @@ -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 {} ';'