Repository navigation
Improve: publish the demo as a static copy of the released image - #525
Merged
Merged
Conversation
Add a Demo workflow that starts a released image in demo mode, records its API answers for ten minutes and builds a static copy for Cloudflare Workers static assets. The copy is uploaded as a preview version, checked against the container in a browser, and promoted only when the check passes. The release runs it for stable versions.
Keep the Cloudflare token away from build output: the upload job takes the Wrangler config from the repository, accepts web files only from the build artifact, and passes the token to curl on stdin. Create the Worker with a placeholder page so no unverified build goes live, and serialise demo runs. Record write routes with a valid body so outbound routes replay the demo-mode refusal, record Export, retry a failed replay download, and fail verification when Save, Test or Export show a different result than the container.
SandObserver
force-pushed
the
chore/static-demo-on-cloudflare
branch
from
October 20, 2026 17:18
333fc78 to
6ee508d
Compare
A page open across a promotion keeps requesting the previous release's replay chunks, which the new version no longer serves. A 404 now reloads the page once, at most once a minute.
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.
Summary
.github/workflows/demo.yml: start a released image withDEMO_MODE=true, tour the dashboard and admin in Chromium, record every API answer every 5 s for 10 minutes, and build a static copy of the image's web root.scripts/demo/replay.jsinto every page. It answers/api/requests from the recording by current time, loops it, shifts recorded timestamps, and falls back to the image's own answers for writes and unrecorded queries._headersand_redirectsfrom the headers the image sends for every file and route.scripts/demo/wrangler.jsoncfrom the repository, accepts only web files (no links, dotfiles,node_modules,package*.jsonor Wrangler config) from the build artifact, and passes the token to curl on stdin.Testing
All green. Added 21 tests; the full pipeline passed against the 1.18.0 image on a local Workers server and failed on a dropped answer, a weakened header, a wrong Test result and a missing Export.
Changelog
Checklist