Skip to content

Commit

Permalink
Setup GitHub Pages deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
pmuens committed Jun 26, 2024
1 parent d7e658f commit 64d6e18
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 0 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
@@ -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

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
cache: npm
- name: Install dependencies
run: npm ci
working-directory: frontend
- name: Build
run: npm run build
working-directory: frontend
- name: Setup Pages
uses: actions/configure-pages@v4
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: ./dist
working-directory: frontend
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
1 change: 1 addition & 0 deletions frontend/vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ import preact from "@preact/preset-vite";
export default defineConfig({
plugins: [preact()],
assetsInclude: ["src/assets/*.wasm"],
base: "/time-lock-puzzle/",
});

0 comments on commit 64d6e18

Please sign in to comment.