chore(pages): deploy the demo from CI instead of by hand - #42
Merged
Conversation
`npm run publish:demo` pushed demo/ to a gh-pages branch from a laptop, which made merging and deploying two separate events. Merging #40 did not change the live site — it kept serving the old page until publish:demo was run separately. A merged PR that silently leaves production stale is the failure mode worth removing. It also published the working directory rather than a commit: whatever was on disk went live, with nothing recording which commit the site matched. pages.yml deploys demo/ on every push to main that touches it, from the checked-out commit, so a merge is a deploy and every deploy maps to a SHA. It keeps both behaviours the old script had: index-local.html is excluded (it loads ../dist/, which resolves above the site root once published), and .nojekyll is written so Pages doesn't drop files starting with "_". Verified before switching: the staged tree is byte-identical to what gh-pages serves today — same 12 files, matching SHA-256 on all eleven published assets. Drops the gh-pages devDependency and the publish:demo script, and rewrites the CONTRIBUTING section that documented the manual flow. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Standardises this repo on the same Pages flow as QuickToss: deploy from
mainvia GitHub Actions, rather than pushing agh-pagesbranch from a laptop.Why
npm run publish:demomade merging and deploying two separate events. Merging #40 did not change the live site —h4md1.fr/visual-image-tool/kept serving the old demo page untilpublish:demowas run separately. A merged PR that silently leaves production stale is the failure mode worth removing.It also published the working directory, not a commit. Whatever was on disk went live — dirty tree, wrong branch, unpulled changes — with nothing recording which commit the site corresponded to.
What it keeps
Both behaviours the old script had, because losing either would be silent:
index-local.htmlstays unpublished. It loads../dist/visual-image-tool.umd.js, which resolves above the site root once published and 404s. The old--src "**/!(index-local).*"filter excluded it; the workflow does the same withrsync --exclude..nojekyllis written. Without it Pages runs Jekyll and drops any file whose name starts with an underscore.Verified byte-identical before switching
I staged the workflow's output locally and diffed it against what
gh-pagesserves right now:So the deploy is a no-op for visitors — same bytes, different delivery.
Also
gh-pagesdevDependency and thepublish:demoscript.workflow_dispatchfrom the Actions tab).CHANGELOGreference topublish:demois left alone — it's a historical entry for a shipped release, and this changes nothing for anyone installing the package.After merge
Pages source has to be flipped from
gh-pagesbranch to GitHub Actions, then thegh-pagesbranch deleted. Doing that immediately after merging.Full gate green: lint, format, types, 18 tests, build.
🤖 Generated with Claude Code