Deployment
The site is built on your machine and pushed to the gh-pages branch. GitHub Pages serves that branch as-is (Settings → Pages → Deploy from a branch: gh-pages, /). There is no deploy workflow.
| Path | Content |
|---|---|
/fish-loop-phaser-demo/ | Landing page with the list of all versions |
/fish-loop-phaser-demo/demo/ | Latest game build |
/fish-loop-phaser-demo/docs/ | Latest documentation |
/fish-loop-phaser-demo/vX.Y.Z/demo/, /vX.Y.Z/docs/ | A frozen release |
Updating latest
Pushing to main does not update the live site by itself. After pushing, run:
npm run release:latestThis requires being on main, in sync with origin/main, so latest always matches GitHub.
Releasing a version
npm version minor # or patch / major: bumps package.json, commits, creates tag vX.Y.Z
git push # optional: share the version bump on main
npm run release # publishes v<package.json version> under /vX.Y.Z/ and pushes the tagYou can also name the version: npm run release -- v0.3.0-beta.1. The script creates the tag if it doesn't exist. Republishing an existing tag requires checking out the commit it points to.
Both commands refuse to run with uncommitted changes, so every release matches a commit. Pages updates about a minute after the push.
How it works
scripts/release.sh:
- Checks out
gh-pagesas a git worktree in.pages/(ignored by git), reset toorigin/gh-pages. Your current branch is never touched. - Runs
scripts/publish-site.sh <latest|vX.Y.Z> .pages. That builds the game and docs with the right base path and version label, writes them to the archive root (latest) or.pages/vX.Y.Z/, and regeneratesversions.json. Other versions are left alone. - Adds
.nojekyll, commits, and pushesgh-pages. For versions it also tags the commit and pushes the tag.
The game menu shows the version it was built as (bottom-right corner), and the docs have a version menu in the top bar.
To remove a version, delete its folder in .pages/, then commit and push gh-pages (or run npm run release:latest afterwards to rebuild versions.json).
Previewing locally
npm run build:site # latest site only, into _site/
npx vite preview --outDir _site