Skip to content

Rework readme and website #231

Rework readme and website

Rework readme and website #231

Workflow file for this run

name: pages
# Build the site (repl + examples gallery + bench page) and deploy to GitHub Pages.
#
# This replaces the old "deploy from branch" model. dist/jz.js, dist/interop.js and
# the example *.wasm are no longer committed — they're built here and uploaded as the
# Pages artifact, so `main` stays source-only. The deployed URL is unchanged
# (https://dy.github.io/jz/); only the source of the bytes moves from the raw repo to
# this build artifact.
#
# One-time setup: Settings → Pages → Source = GitHub Actions.
on:
push:
branches: [main]
paths-ignore:
- '**/*.md'
- 'LICENSE'
- 'test/**'
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
# One deploy at a time; never cancel an in-flight deploy.
concurrency:
group: pages
cancel-in-progress: false
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 24
- uses: actions/configure-pages@v5
- run: npm ci
# Deploy gate: the full suite includes test/web-smoke.js — dist/jz.js compiling
# the REPL default sample + both landing hero grids under browser conditions
# (no Node globals). A commit that breaks in-browser compilation fails HERE and
# the last good deploy stays live (an unguarded process.env in the `for` emitter
# once shipped and broke every loop on every page — never again).
- name: gate — suite + demo/REPL web smoke
run: npm test
- name: build compiler bundle + example wasm
run: |
npm run build # dist/jz.js + dist/interop.js — the repl/playground import these
npm run build:examples # examples/**/*.wasm
node bench/bench.mjs --emit-web # bench/web/*.wasm — the live in-page bench runner (cheap, no measurement)
- name: assemble _site (tracked files + freshly-built artifacts only)
run: |
rm -rf _site && mkdir _site
# tracked files = exactly the repo's source/HTML/thumbs/bench data — no
# node_modules, no .git, no gitignored junk.
git archive HEAD --prefix=_site/ | tar -x
# overlay the just-built artifacts (gitignored, so absent from the archive).
mkdir -p _site/dist && cp dist/jz.js dist/interop.js _site/dist/
# assets/sprae.js is bundled from the `sprae` devDep at build time (a WEB asset, not compiler
# dist): the landing binds its live bench figures with it. site.css + the font in assets/ are
# tracked, so they're already in the archive — only the built sprae.js needs the overlay.
mkdir -p _site/assets && cp assets/sprae.js _site/assets/
find examples -name '*.wasm' -not -path '*/build/*' | while read -r f; do
mkdir -p "_site/$(dirname "$f")" && cp "$f" "_site/$f"
done
# bench/web/*.wasm — built above (gitignored), feeds bench/index.html's live runner.
mkdir -p _site/bench/web && cp bench/web/*.wasm _site/bench/web/
- uses: actions/upload-pages-artifact@v3
with:
path: _site
deploy:
needs: build
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- id: deployment
uses: actions/deploy-pages@v4