Skip to content

fix: use CriticalPathFirst leveling strategy in WASM playground #40

fix: use CriticalPathFirst leveling strategy in WASM playground

fix: use CriticalPathFirst leveling strategy in WASM playground #40

name: Deploy Playground to GitHub Pages
on:
push:
branches: [main]
paths:
- 'playground/**'
- 'crates/utf8proj-wasm/**'
- 'crates/utf8proj-core/**'
- 'crates/utf8proj-parser/**'
- 'crates/utf8proj-solver/**'
- 'crates/utf8proj-render/**'
- '.github/workflows/deploy-playground.yml'
workflow_dispatch: # Allow manual trigger
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
# Allow only one concurrent deployment
concurrency:
group: "pages"
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: wasm32-unknown-unknown
- name: Install wasm-pack
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
- name: Build WASM
run: |
cd crates/utf8proj-wasm
wasm-pack build --target web --out-dir ../../playground/pkg
# Remove .gitignore that wasm-pack creates (it ignores all files)
rm -f ../../playground/pkg/.gitignore
- name: Setup Pages
uses: actions/configure-pages@v4
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: './playground'
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4