From 47b147599964fd634a36cb5691404084c67925ef Mon Sep 17 00:00:00 2001 From: martin veillette Date: Sat, 15 Aug 2026 15:19:21 -0400 Subject: [PATCH] docs: require workflow_dispatch on sim Pages deploy callers Align the caller contract with CrystalLattice and Baton's own pages.yml so a missed push can be recovered by hand. --- CONVENTIONS.md | 4 +++- README.md | 14 ++++++++++++-- doc/add-simulation.md | 2 +- scripts/check-repo-compliance.sh | 12 ++++++++++++ 4 files changed, 28 insertions(+), 4 deletions(-) diff --git a/CONVENTIONS.md b/CONVENTIONS.md index 3554e98..4fcb339 100644 --- a/CONVENTIONS.md +++ b/CONVENTIONS.md @@ -149,7 +149,8 @@ License / Contributing` (enforced by Baton's compliance check). Do **not** add a | `package.json` | `scenerystack ^3`, `vite ^8`, `typescript ^7`, `@biomejs/biome ^2.5`, `vitest ^4`; standard `scripts` block | | `.githooks/{pre-commit,pre-push}` | present; activated via `prepare` script on `npm install` | | `.github/workflows/ci.yml` | calls `OpenPhysics/Baton` reusable CI + shared security workflows | -| `.github/dependabot.yml` | present | +| `.github/workflows/deploy.yml` | calls `OpenPhysics/Baton` reusable Pages deploy; `on: push` to `main` **and** `workflow_dispatch` | +| `.github/dependabot.yml` | present (synced from `Baton/config/dependabot-npm.yml`) | **PWA** (`vite-plugin-pwa`) is fleet-standard. Copy the template's `VitePWA({…})` block, `scripts/generate-icons.ts`, and `index.html` meta; only `id` / `name` / `short_name` / `description` / `theme_color` / screenshot `label` change per sim. @@ -218,6 +219,7 @@ rest are a quick manual scan. - [ ] `tests/memory-leak.test.ts` exists and `vitest.config.ts` enables `--expose-gc`. *(auto)* - [ ] `*KeyboardHelpContent.ts` exists under `src/` (Keyboard Shortcuts dialog). *(auto)* - [ ] `.githooks/{pre-commit,pre-push}` present; `prepare` sets `core.hooksPath`. *(auto)* +- [ ] `.github/workflows/deploy.yml` calls Baton's reusable Pages deploy and allows `workflow_dispatch`. *(auto)* - [ ] PWA: `VitePWA` manifest has `id`, `categories`, `display_override`, screenshots, no `orientation`; `public/icons/` + `public/screenshots/{wide,narrow}.png` exist; `index.html` has theme-color + OG/Twitter. *(auto)* - [ ] `doc/model.md` + `doc/implementation-notes.md` exist and are filled. *(auto presence; manual content)* - [ ] `README.md` follows the six-section outline; no local `CONTRIBUTING.md` / `LICENSE`. *(auto)* diff --git a/README.md b/README.md index 02ba193..b918e06 100644 --- a/README.md +++ b/README.md @@ -96,9 +96,18 @@ Optional compliance checking: flag needed. Pass `run-tests: "true"` to force it on (e.g. before a test script exists) or `run-tests: "false"` to opt out. -Pages deploy (sims that publish to GitHub Pages): +Pages deploy (sims that publish to GitHub Pages). Callers use `push` to `main` **and** +`workflow_dispatch`, so a site can be published without waiting for a push (same pair of +triggers as this repo's [`pages.yml`](.github/workflows/pages.yml)): ```yaml +name: Deploy + +on: + push: + branches: [main] + workflow_dispatch: + jobs: deploy: uses: OpenPhysics/Baton/.github/workflows/deploy.yml@main @@ -120,7 +129,8 @@ unless marked *(warn)*): Stack → License → Contributing**). - **CI wiring** — `.github/workflows/ci.yml` calls this repo's reusable `ci.yml` plus [`shared-dependency-review.yml`](.github/workflows/shared-dependency-review.yml) and - [`shared-codeql.yml`](.github/workflows/shared-codeql.yml); `.github/dependabot.yml` present. + [`shared-codeql.yml`](.github/workflows/shared-codeql.yml); `.github/workflows/deploy.yml` + calls the reusable Pages deploy and allows `workflow_dispatch`; `.github/dependabot.yml` present. - **Node pins** — `engines.node` is `>=24` and `@types/node` major is `24` (matching the fleet Node version); a `.nvmrc` / `.node-version`, if present, agrees. - **SceneryStack structure** (sims only) — the five-file bootstrap chain with `main.ts` importing diff --git a/doc/add-simulation.md b/doc/add-simulation.md index fa5b9b9..d633138 100644 --- a/doc/add-simulation.md +++ b/doc/add-simulation.md @@ -49,7 +49,7 @@ npm run check Then confirm: - `.github/workflows/ci.yml` calls `OpenPhysics/Baton/.../ci.yml@main` -- `.github/workflows/deploy.yml` (or equivalent) calls Baton's reusable Pages deploy +- `.github/workflows/deploy.yml` (or equivalent) calls Baton's reusable Pages deploy and allows `workflow_dispatch` - README follows the six-section outline (enforced by compliance — see [`CONVENTIONS.md`](../CONVENTIONS.md)) diff --git a/scripts/check-repo-compliance.sh b/scripts/check-repo-compliance.sh index 3f38a86..a94e856 100755 --- a/scripts/check-repo-compliance.sh +++ b/scripts/check-repo-compliance.sh @@ -316,6 +316,18 @@ if [ -f package.json ] && [ -f src/main.ts ]; then fi [ "$hooks_ok" -eq 1 ] && pass ".githooks/ pre-commit + pre-push with prepare activation" + # Pages deploy (CONVENTIONS.md §7): reusable Baton workflow + manual dispatch, + # matching Baton's own pages.yml triggers so a missed push can be recovered. + if [ ! -f .github/workflows/deploy.yml ]; then + fail ".github/workflows/deploy.yml is missing" + elif ! grep -q "OpenPhysics/Baton/.github/workflows/deploy.yml@main" .github/workflows/deploy.yml; then + fail "deploy.yml must call OpenPhysics/Baton reusable deploy workflow" + elif ! grep -q "workflow_dispatch:" .github/workflows/deploy.yml; then + fail "deploy.yml must allow workflow_dispatch (manual Pages publish)" + else + pass "deploy.yml uses shared reusable workflow with workflow_dispatch" + fi + # PWA (CONVENTIONS.md §7): vite-plugin-pwa + generate-icons + public assets + index meta. if ! grep -q '"vite-plugin-pwa"' package.json; then fail "package.json is missing vite-plugin-pwa"