1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# Deploys the wasm demo to GitHub Pages (https://fschutt.github.io/printpdf/).
#
# Runs on release tags and manually. The build is scripts/build-demo.sh — the
# SAME script the demo-e2e workflow tests on every push, so what deploys is
# what was tested. (The previous version of this workflow was manual-only and
# regex-injected base64 fonts into script.js; the demo on Pages went 5 months
# stale without anyone noticing, which is how the "save error" of early 2026
# survived long after the underlying bug was fixed.)
name: Deploy demo to Pages
on:
push:
tags:
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
# Allow only one concurrent deployment; never cancel an in-progress production
# deploy.
concurrency:
group: "pages"
cancel-in-progress: false
jobs:
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
timeout-minutes: 45
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
targets: wasm32-unknown-unknown
- name: Install wasm-pack (prebuilt)
run: |
set -euo pipefail
curl -sL https://github.com/rustwasm/wasm-pack/releases/download/v0.13.1/wasm-pack-v0.13.1-x86_64-unknown-linux-musl.tar.gz \
| tar xz --strip-components=1 -C /usr/local/bin --wildcards '*/wasm-pack'
- name: Build the demo (wasm + default fonts)
run: bash scripts/build-demo.sh
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Upload site
uses: actions/upload-pages-artifact@v3
with:
# Repo root: index.html, style.css, script.js, default-fonts.js, pkg/,
# and examples/assets (the recipe example fetches cat.jpg from there).
path: "."
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4