Skip to content

Merge pull request #84 from PhysShell/claude/modest-maxwell-0zecwn #14

Merge pull request #84 from PhysShell/claude/modest-maxwell-0zecwn

Merge pull request #84 from PhysShell/claude/modest-maxwell-0zecwn #14

Workflow file for this run

name: web-playground
# Builds the WASM playground (web/) and deploys it to GitHub Pages.
# Enable once under repo Settings → Pages → Source: "GitHub Actions".
on:
push:
branches: [main]
paths: ['web/**', 'core/**', '.github/workflows/web.yml']
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
# One deploy at a time; let an in-progress run finish.
concurrency:
group: pages
cancel-in-progress: false
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install wasm target
run: rustup target add wasm32-unknown-unknown
- name: Cache cargo
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
web/target
key: web-wasm-${{ hashFiles('web/Cargo.toml', 'core/Cargo.toml') }}
# GP support needs wasm-bindgen (ADR-0025); the CLI must match the crate
# version pinned in web/Cargo.toml. Cache the built binary across runs.
- name: Cache wasm-bindgen-cli
uses: actions/cache@v4
with:
path: ~/.cargo/bin/wasm-bindgen
key: wasm-bindgen-cli-${{ hashFiles('web/Cargo.toml') }}
- name: Install wasm-bindgen-cli
run: |
if command -v wasm-bindgen >/dev/null; then
echo "cached: $(wasm-bindgen --version)"; exit 0
fi
ver=$(grep -m1 'wasm-bindgen = ' web/Cargo.toml | grep -oE '[0-9]+\.[0-9]+\.[0-9]+')
cargo install wasm-bindgen-cli --version "$ver" --locked
- name: Build playground
run: ./web/build.sh
- uses: actions/upload-pages-artifact@v3
with:
path: web/dist
deploy:
needs: build
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deploy.outputs.page_url }}
steps:
- id: deploy
uses: actions/deploy-pages@v4