Skip to content

chore(pages): deploy the demo from CI instead of by hand - #42

Merged
killerwolf merged 1 commit into
mainfrom
chore/pages-via-actions
Sep 7, 2026
Merged

chore(pages): deploy the demo from CI instead of by hand#42
killerwolf merged 1 commit into
mainfrom
chore/pages-via-actions

Conversation

@killerwolf

Copy link
Copy Markdown
Owner

Standardises this repo on the same Pages flow as QuickToss: deploy from main via GitHub Actions, rather than pushing a gh-pages branch from a laptop.

Why

npm run publish:demo made merging and deploying two separate events. Merging #40 did not change the live siteh4md1.fr/visual-image-tool/ kept serving the old demo 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, 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.html stays 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 with rsync --exclude.
  • .nojekyll is 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-pages serves right now:

file list:  identical (12 files)
content:    all 11 published assets match SHA-256
            android-chrome-192x192.png, basic-usage.html, custom-config.html,
            demo-esm.html, demo-umd.html, favicon.ico, index.html,
            preact-importmap-demo.html, react-importmap-demo.html,
            social-preview.jpg, vue-importmap-demo.html

So the deploy is a no-op for visitors — same bytes, different delivery.

Also

  • Drops the gh-pages devDependency and the publish:demo script.
  • Rewrites the CONTRIBUTING section that documented the manual flow, including how to re-deploy without a code change (workflow_dispatch from the Actions tab).
  • The CHANGELOG reference to publish:demo is 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-pages branch to GitHub Actions, then the gh-pages branch deleted. Doing that immediately after merging.

Full gate green: lint, format, types, 18 tests, build.

🤖 Generated with Claude Code

`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>
@killerwolf
killerwolf merged commit 3e135aa into main Sep 7, 2026
2 checks passed
@killerwolf
killerwolf deleted the chore/pages-via-actions branch September 7, 2026 18:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant