Hosting this site
This documentation site is an Astro Starlight project in apps/docs. It deploys as static assets on Cloudflare Workers at https://lumen-timeline.studiocyf.app.
| Site | Address | Source | Workflow |
|---|---|---|---|
| Documentation | https://lumen-timeline.studiocyf.app |
apps/docs |
.github/workflows/docs.yml |
npm run build # builds the @lumen-timeline/* workspace packagesnpm run docs:dev # http://localhost:4321npm run docs:build # writes apps/docs/distnpm run check:docs # builds, type-checks and runs unit + browser testsBefore astro dev or astro build, apps/docs/scripts/generate.ts generates the pages whose source of truth lives elsewhere in the repository so the site cannot drift from it:
| Pages | Source |
|---|---|
| Architecture | docs/design.md, docs/core-architecture.md, ROADMAP.md |
| Guides | docs/headless-editing.md, docs/selective-history.md, docs/playback-read-api.md, docs/media-transports.md, docs/incremental-playback.md, docs/vanilla-timeline.md, docs/waveforms.md, docs/sync.md |
| Frameworks | docs/frameworks.md |
| Packages | packages/*/package.json, packages/*/api/index.d.ts |
| Benchmarks | docs/clock-and-wasm.md, docs/measurements/*.json |
The build also produces /llms.txt, /llms-full.txt, and /llms-small.txt, along with a plain Markdown copy of every English page at the same path with .md replacing the trailing slash (for example, /guides/editing.md and /index.md).
Interactive examples (studio and sync) run the real workspace packages in isolated frames under /demo/<name>/. After astro build, apps/docs/scripts/demo-frames.ts adds <link rel="modulepreload"> tags for every imported module and inlines each demo page into its embedding iframe via srcdoc, removing the extra round trip on first load.
Deploy to Cloudflare Workers
Section titled “Deploy to Cloudflare Workers”apps/docs/wrangler.jsonc deploys apps/docs/dist as static assets. Because no Worker script runs, requests do not count toward the free plan’s daily Worker invocation limit.
To deploy from your machine, build first, install the pinned Wrangler in tools/deploy, and run the deploy script. Wrangler uses the account you logged in to with wrangler login.
npm run build && npm run check:docsnpm ci --prefix tools/deploy --ignore-scriptsnpm run deploy:docsThe workflow in .github/workflows/docs.yml does nothing until you configure it:
- Create a Cloudflare API token as described in The API token.
- In the repository settings, create an environment named
cloudflare. Under its deployment branches, allow onlymain. Add the token as the environment secretCLOUDFLARE_API_TOKENand your account ID as the environment secretCLOUDFLARE_ACCOUNT_ID. Use environment secrets, not repository secrets, so only runs onmaincan read them. - Set the repository variable
DOCS_SITEtohttps://lumen-timeline.studiocyf.app. Canonical links, the sitemap andllms.txtare built from this value. - Run the Docs workflow manually from the Actions tab (
workflow_dispatch). - To deploy automatically on every push to
main, set the repository variableDOCS_DEPLOYtotrue.
The API token
Section titled “The API token”Cloudflare cannot scope a token to a single Worker. Give the token only the two permissions deployment needs:
| Scope | Permission | Resources |
|---|---|---|
| Account | Workers Scripts: Edit | Only the account that holds the site |
| Zone | Workers Routes: Edit | Only the zone of the site’s hostname (studiocyf.app) |
The “Edit Cloudflare Workers” template also works, but adds KV, R2 and Pages permissions that this deployment never uses. Set an expiry date and rotate the token before it expires.
How the workflow protects the token
Section titled “How the workflow protects the token”The repository is public, so .github/workflows/docs.yml assumes anyone can read it and open a pull request:
- The workflow never runs on pull requests, and GitHub never exposes environment secrets to fork pull requests.
- The secrets live in the
cloudflareenvironment, restricted tomain. Changes on other branches cannot read them. - Building and deploying are separate jobs. The
buildjob runs application and dependency code with no secrets. Thedeployjob holds the Cloudflare credentials and runs only Wrangler on the uploadeddocs-siteartifact. - Wrangler is pinned in
tools/deploy/package.jsonandtools/deploy/package-lock.jsonby exact version and SHA-512 integrity hash. Thedeployjob installs it withnpm ci --prefix tools/deploy --ignore-scriptsandcache: false, running zero package lifecycle scripts and restoring no cache written by the build job. - Every GitHub Action in
.github/workflows/docs.ymlis pinned to a full commit SHA..github/dependabot.ymlproposes updated commits once a month after a 14-day release cooldown. - The account ID is stored as a secret so GitHub masks it in logs;
apps/docs/wrangler.jsoncdoes not containaccount_id.
Never commit .wrangler/ or .dev.vars: the first records local Cloudflare account state and the second holds local secrets. Both are in .gitignore.
Use a domain of your own
Section titled “Use a domain of your own”apps/docs/wrangler.jsonc binds the site to lumen-timeline.studiocyf.app as a Workers Custom Domain. On deploy, Cloudflare ensures the DNS record and TLS certificate exist.
- The apex zone (
studiocyf.app) must belong to the same Cloudflare account, andlumen-timeline.studiocyf.appmust not already have a conflicting CNAME record. Do not create the DNS record manually. workers_devandpreview_urlsare bothfalse, so the site is published only at its custom domain and never on a*.workers.devsubdomain.
In a fork, replace pattern in apps/docs/wrangler.jsonc with a hostname in your own Cloudflare zone and set DOCS_SITE to match. To publish to *.workers.dev instead, remove routes and set "workers_dev": true.
GitHub Pages instead
Section titled “GitHub Pages instead”You can also serve apps/docs/dist on GitHub Pages without Cloudflare DNS. Build with DOCS_SITE=https://<your-host> npm run docs:build, upload apps/docs/dist with actions/upload-pages-artifact, and deploy with actions/deploy-pages. Note that GitHub Pages ignores apps/docs/public/_headers, so /*.md and /llms.txt use GitHub’s default content types and hashed assets under /_astro/* do not receive immutable cache headers.