Skip to content

release: 0.7.0 (#101) #65

release: 0.7.0 (#101)

release: 0.7.0 (#101) #65

Workflow file for this run

name: pages
# Build the docs site (mdBook) and the WASM playground, and publish both as ONE
# GitHub Pages deployment: the book at the site root, the playground under
# /playground/. Pages allows a single deployment per repo, so this workflow is the
# only one that may deploy (concurrency group `pages` enforces that).
# Enable once under Settings -> Pages -> Source: GitHub Actions.
on:
push:
branches: [main]
paths:
- "docs/**"
- "playground/**"
- "src/**"
- "Cargo.toml"
- ".github/workflows/pages.yml"
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: pages
cancel-in-progress: true
jobs:
build-deploy:
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deploy.outputs.page_url }}
steps:
- uses: actions/checkout@v6
# Match the toolchain pinned by rust-toolchain.toml, with the wasm target.
- uses: dtolnay/rust-toolchain@master
with:
toolchain: "1.97.0"
targets: wasm32-unknown-unknown
# Pinned like mdBook below: the installer script takes whatever is newest that
# day, which is the one unpinned tool in a pipeline that otherwise reproduces.
- name: Install wasm-pack
run: |
mkdir -p "$HOME/.local/bin"
curl -sSL https://github.com/rustwasm/wasm-pack/releases/download/v0.15.0/wasm-pack-v0.15.0-x86_64-unknown-linux-musl.tar.gz \
| tar -xz --strip-components=1 -C "$HOME/.local/bin" \
wasm-pack-v0.15.0-x86_64-unknown-linux-musl/wasm-pack
chmod +x "$HOME/.local/bin/wasm-pack"
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
# Without this every deploy recompiles the whole compiler for wasm32 from zero.
- uses: Swatinem/rust-cache@v2
with:
workspaces: playground
# Prebuilt binary: keeps the job Rust-toolchain-only, no compile, no pip.
- name: Install mdBook
run: |
mkdir -p "$HOME/.local/bin"
curl -sSL https://github.com/rust-lang/mdBook/releases/download/v0.5.4/mdbook-v0.5.4-x86_64-unknown-linux-musl.tar.gz \
| tar -xz -C "$HOME/.local/bin"
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
- name: Build WASM
run: wasm-pack build playground --target web --out-dir web/pkg --release
- name: Build the book
run: mdbook build docs
- name: Assemble site (book at root, playground under /playground/)
run: |
mkdir -p _site/playground
cp -r docs/book/. _site/
cp -r playground/web/. _site/playground/
- uses: actions/configure-pages@v5
- uses: actions/upload-pages-artifact@v3
with:
path: _site
- id: deploy
uses: actions/deploy-pages@v4