Skip to content

pages: Cloudflare Pages at docs.spinbox.dev, a preview for every branch - #124

Open
aledbf wants to merge 3 commits into
mainfrom
infra-cloudflare
Open

aledbf wants to merge 3 commits into
mainfrom
infra-cloudflare

Conversation

@aledbf

@aledbf aledbf commented Nov 19, 2026 •

Copy link
Copy Markdown
Member

Stacked on #123 (and #122).

What changes

  • The site is served at the root of https://docs.spinbox.dev (astro.config.mjs: site and base defaults; BASE_PATH stays an option). Checked in dist/: every content link, canonical, og:url, the cards' og:image (https://docs.spinbox.dev/cards/<page>.png, built from site + base in Head.astro), apple-touch-icon, llms.txt and llms-full.txt, the sitemap and the .md twins; nothing left says /website/. linkcheck -site, the sync issue's header and ui-hill-climb/screens.json follow.
  • Cloudflare Pages replaces GitHub Pages, with the blog's tasks: task upload puts dist/, as task check built it, in project spinbox-docs as its branch; task deploy builds and uploads from a checkout; task cf:setup creates the project and attaches docs.spinbox.dev, once. main is production; any other branch is a preview at https://<branch>.spinbox-docs.pages.dev/, public (no Access). The pull request gets one comment with the preview's address, edited at each push, and the job summary says it too. The upload-pages-artifact step and the deploy job are gone.
  • wrangler is a locked devDependency (4.156.1, the blog's), installed through sfw in the image like everything else, instead of the blog's npm install -g (which sfw check refuses). workerd's install script is denied in pnpm-workspace.yaml: an upload of static files runs no worker. Checked: wrangler pages deploy in the image reaches Cloudflare's API.
  • Forks and Dependabot: the Upload step runs only when CLOUDFLARE_API_TOKEN is there, so a fork's pull request runs the check and uploads nothing.

go tool task check passes.

For the author, by hand

  1. Secrets: CLOUDFLARE_API_TOKEN (Account > Cloudflare Pages: Edit) and CLOUDFLARE_ACCOUNT_ID as repository secrets; as Dependabot secrets too if its pull requests should get previews. Until they exist, CI skips the upload, so merging is safe before.
  2. go tool task cf:setup once, with both in the environment.
  3. DNS: docs.spinbox.dev is a CNAME to spinbox-docs.pages.dev in the Route 53 zone, as blog.spinbox.dev is: Pages serves an apex only from a zone on Cloudflare DNS, and spinbox.dev's zone is the one the installation's Terraform keeps. The record is a pull request in spinbox.dev-deploy, merged after task cf:setup has attached the name.
  4. After cutover: unpublish GitHub Pages (Settings > Pages) and delete the github-pages environment; it keeps serving its last deploy until then. Set the repository's website to the new address (it says https://spin-stack.github.io/website/).
  5. Links to the old address elsewhere, to change after cutover: spin-stack/brand index.html (two links: the product, and the dashboard page). Nothing in spin-terraform-aws, spin-machine or go-tools. References in private repositories are listed for the author separately.

🤖 Generated with Claude Code

Base automatically changed from infra-lint to main November 19, 2026 18:16
@aledbf aledbf changed the title pages: Cloudflare Pages at spinbox.dev, a preview for every pull request pages: Cloudflare Pages at docs.spinbox.dev, a preview for every branch Nov 19, 2026
aledbf and others added 3 commits November 19, 2026 15:23
The site moves from the GitHub project page under /website to the apex of
spinbox.dev. The base stays configurable (BASE_PATH), and every link, the
cards' og:image, llms.txt and the Markdown twins follow it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…branch

task upload puts dist/, as task check built it, in the spinbox-docs project as
its branch: main is production at spinbox.dev, any other branch a public
preview at its pages.dev alias, which its pull request is told in one comment.
wrangler is a locked dependency, installed through the firewall in the image.
A fork's pull request has no Cloudflare secret, and runs the check without
uploading. task deploy and task cf:setup are the blog's.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Cloudflare Pages serves an apex only from a zone on its own DNS, and
spinbox.dev's zone is Route 53's, the one the installation keeps. The
docs take a name of their own in it, as blog.spinbox.dev does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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