Skip to content

Commit

Permalink
Deploy to GH pages
Browse files Browse the repository at this point in the history
  • Loading branch information
dabreegster committed Dec 21, 2024
1 parent 74f3955 commit 34cefa7
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/web.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Deploy web

on:
push:
branches: [main]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Install node
uses: actions/setup-node@v3
with:
node-version: 20
cache: "npm"
cache-dependency-path: web/package-lock.json

- name: Install wasm-pack
uses: jetli/[email protected]

- name: Cache WASM build
uses: actions/cache@v4
with:
path: backend/target
key: cargo-${{ hashFiles('backend/Cargo.lock') }}

- name: Build web app
run: |
cd web
npm ci
npm run wasm-release
npm run build --if-present
# TODO Vite suddenly broke and I have no idea why. Hack around it.
# new URL('backend_bg.wasm', import.meta.url) doesn't exist at build time, it will remain unchanged to be resolved at runtime
ln -s assets/backend_bg.wasm dist/
- name: Publish
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./web/dist/

0 comments on commit 34cefa7

Please sign in to comment.