Skip to content

Commit 8ea61c0

Browse files
committed
WASM
1 parent 1260c13 commit 8ea61c0

20 files changed

Lines changed: 1363 additions & 671 deletions

.github/workflows/deploy.yml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
name: Deploy to GitHub Pages
2+
3+
on:
4+
push:
5+
branches: [main]
6+
workflow_dispatch:
7+
8+
permissions:
9+
contents: read
10+
pages: write
11+
id-token: write
12+
13+
# Only one deployment runs at a time; in-progress deploys are NOT cancelled
14+
# so a mid-flight deploy always completes.
15+
concurrency:
16+
group: pages
17+
cancel-in-progress: false
18+
19+
jobs:
20+
build:
21+
runs-on: ubuntu-latest
22+
steps:
23+
- uses: actions/checkout@v4
24+
25+
- name: Install Rust (stable + wasm32 target)
26+
uses: dtolnay/rust-toolchain@stable
27+
with:
28+
targets: wasm32-unknown-unknown
29+
30+
- name: Cache Rust build
31+
uses: Swatinem/rust-cache@v2
32+
with:
33+
workspaces: wasm
34+
35+
- name: Install wasm-pack
36+
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
37+
38+
- name: Build WASM
39+
run: wasm-pack build wasm --target bundler --out-dir ../frontend/src/wasm-pkg --release
40+
41+
- name: Setup Node 22
42+
uses: actions/setup-node@v4
43+
with:
44+
node-version: 22
45+
cache: npm
46+
cache-dependency-path: frontend/package-lock.json
47+
48+
- name: Install npm dependencies
49+
working-directory: frontend
50+
run: npm ci
51+
52+
- name: Build frontend
53+
working-directory: frontend
54+
run: npm run build:fe
55+
env:
56+
VITE_BASE: ./
57+
58+
- name: Upload Pages artifact
59+
uses: actions/upload-pages-artifact@v3
60+
with:
61+
path: frontend/dist
62+
63+
deploy:
64+
needs: build
65+
runs-on: ubuntu-latest
66+
environment:
67+
name: github-pages
68+
url: ${{ steps.deploy.outputs.page_url }}
69+
steps:
70+
- name: Deploy to GitHub Pages
71+
id: deploy
72+
uses: actions/deploy-pages@v4

.gitignore

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,9 @@ wheels/
1010
.venv
1111
node_modules
1212

13-
.claude
13+
# Rust/WASM build artifacts
14+
wasm/target/
15+
frontend/src/wasm-pkg/
16+
17+
.claude
18+
target

api/index.py

Lines changed: 0 additions & 6 deletions
This file was deleted.

0 commit comments

Comments
 (0)