From 6bd84de8307c81beb4924ed2adfe9b90202fea7c Mon Sep 17 00:00:00 2001 From: Philipp Muens Date: Wed, 26 Jun 2024 15:37:25 +0200 Subject: [PATCH] Setup GitHub Pages deployment --- .github/workflows/deploy.yml | 46 ++++++++++++++++++++++++++++++++++++ frontend/vite.config.js | 1 + 2 files changed, 47 insertions(+) create mode 100644 .github/workflows/deploy.yml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..812f210 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,46 @@ +name: Deploy Vite frontend to GitHub Pages + +on: + push: + branches: [master] + workflow_dispatch: + +permissions: + contents: read + pages: write + id-token: write + +concurrency: + group: pages + cancel-in-progress: true + +defaults: + run: + working-directory: frontend + +jobs: + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Set up Node + uses: actions/setup-node@v4 + with: + node-version: 20 + - name: Install dependencies + run: npm ci + - name: Build + run: npm run build + - 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/vite.config.js b/frontend/vite.config.js index 674b892..3c3567f 100644 --- a/frontend/vite.config.js +++ b/frontend/vite.config.js @@ -5,4 +5,5 @@ import preact from "@preact/preset-vite"; export default defineConfig({ plugins: [preact()], assetsInclude: ["src/assets/*.wasm"], + base: "/time-lock-puzzle/", });