Generate the demo page at deploy time instead of committing it - #5
Merged
Conversation
The interactive demo was a 1.5 MB generated blob checked into the repo, which made it wrong in two ways at once. It went stale at every release — it spent this morning advertising 1.1.0, was hand-refreshed to 1.1.1, and 1.1.2 made it wrong again an hour later — and it embedded the absolute path of whichever machine produced it, including the username, on a page served publicly from GitHub Pages. Both are properties of committing a build artifact, so the fix is to stop committing it. The Pages workflow now builds it on the runner from synthetic mock data, into a store under /tmp rather than the runner's own temp dir: that sits under /home/runner, and a data home inside $HOME is exactly the shape that leaked a username before. Three guards run before anything deploys — the page is non-empty, it is flagged "demo":true, and it contains no home-directory path — so a page carrying real data fails the deploy rather than reaching the web. Code paths are now in the trigger. With only site/** there, a release that changed the version would not have refreshed the demo, which is how it fell behind in the first place. Verified by running the workflow's steps locally: 1,822 records, 1.5 MB, appVersion tracking package.json, dataHome /tmp/tokenflow-demo-store, all three guards passing. Each regeneration also stops adding 1.5 MB to the repository's history for good. Co-Authored-By: Claude Opus 5 (1M context) <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.
The interactive demo was a 1.5 MB generated blob checked into the repo, which made it wrong in two ways at once.
It went stale at every release. It spent this morning advertising 1.1.0, was hand-refreshed to 1.1.1, and 1.1.2 made it wrong again an hour later.
It embedded the absolute path of whichever machine produced it — including the username — on a page served publicly from GitHub Pages.
Both are properties of committing a build artifact. So it is no longer committed: the Pages workflow builds it on the runner from synthetic mock data.
Details worth knowing
The store goes in
/tmp, deliberately notrunner.temp— that sits under/home/runner, and a data home inside$HOMEis exactly the shape that leaked a username before. (My first attempt usedrunner.tempand the leak check would have failed every deploy.)Three guards run before anything reaches the web, so a page carrying real data fails the deploy instead of being published:
Code paths are now in the trigger (
bin/**,src/**,package.json). With onlysite/**there, a release that changed the version would not have refreshed the demo — which is how it fell behind in the first place.--days 60keeps the page near 1.5 MB; the 160-day default produces 3.2 MB.Verification
The workflow's steps, run locally:
appVersionpackage.jsondataHome/tmp/tokenflow-demo-storeAlso: each regeneration stops adding 1.5 MB to the repository's history for good. This diff removes 7,642 lines of generated blob.
🤖 Generated with Claude Code