Skip to content

Deploy playground.hello.dev from Cloudflare Workers - #100

Merged
dickhardt merged 5 commits into
mainfrom
cloudflare
Sep 6, 2026
Merged

Deploy playground.hello.dev from Cloudflare Workers#100
dickhardt merged 5 commits into
mainfrom
cloudflare

Conversation

@dickhardt

Copy link
Copy Markdown
Member

Do not merge until the Cloudflare side is live. main is production for this repo, and the old AWS sync workflow is removed here, so merging early would break the current deploy.

What this does

  • Renames the build output dir S3/ to dist/ (Workers static assets, not R2 or S3).
  • Adds wrangler.toml with a custom domain route on the hello.dev zone.
  • Removes .github/workflows/sync.yml (AWS S3 sync). merge.yml (build + tests) stays as the required PR check.
  • Adds public/_headers with the CSP copied from CDN/cdk/lib/csp.ts.
  • Adds .nvmrc (Node 22) for Workers Builds, wrangler as a dev dependency, and a deploy script.

Deploy model (option C)

  1. GitHub Actions Ready for merge runs build + tests on every PR (unchanged, already required).
  2. Cloudflare Workers Builds is connected to this repo. It posts a preview build check on PRs and deploys main on merge.
  3. Branch protection requires both checks.

Cutover checklist (manual, Cloudflare dashboard + Squarespace)

  • Create the hello.dev zone in the Hellō Cloudflare account; recreate the current Route53 records (www, playground, hello.dev apex, blog, console, quickstart, console-beta, opc-test, google-site-verification TXT, _gh-hellocoop-o TXT) pointing at the existing CloudFront hostnames.
  • Change nameservers at Squarespace to the Cloudflare pair. Wait for activation.
  • Workers & Pages → Create → import this repo. Build command npm run build, deploy command npx wrangler deploy, production branch main, non-production builds on.
  • Branch protection on main: add the Cloudflare Workers check to required status checks.
  • Merge this PR. Confirm the custom domain route attaches and the site serves from Cloudflare.
  • Delete the matching stack in CDN/cdk/bin/static.ts and cdk destroy it.

Verified locally: npm run build into dist/ and wrangler deploy --dry-run both pass.

Also: worker/index.js proxies POST /api/event to plausible.io, forwarding User-Agent and the client IP as X-Forwarded-For. src/lib/utils.js posts pageviews there; CloudFront used to proxy the path.

🤖 Generated with Claude Code

https://claude.ai/code/session_01TUaEMyd8MGXZpFA4jHVm6E

dickhardt and others added 3 commits September 4, 2026 19:39
Rename the Vite output dir S3/ to dist/, add wrangler.toml for Workers
static assets on the hello.dev zone, and add a small worker that proxies
POST /api/event to Plausible (CloudFront did this before). Move the CSP
into public/_headers. Remove the AWS S3 sync workflow; Cloudflare
Workers Builds deploys main on merge.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TUaEMyd8MGXZpFA4jHVm6E
The custom domain route needs the zone in the account; keep it commented
until the nameserver cutover so Workers Builds can deploy now.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TUaEMyd8MGXZpFA4jHVm6E
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Sep 4, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
❌ Deployment failed
View logs
playground-hello-dev df005f6 Sep 06 2026, 01:08 PM

@dickhardt

Copy link
Copy Markdown
Member Author

Status 2026-09-04

Workers Builds is connected in the Hellō Cloudflare account. Production branch is temporarily cloudflare so this branch deploys now; flip it to main in Settings → Builds → Branch control at cutover. The Workers Builds check on this PR is the one to add to required status checks.

Preview: https://playground-hello-dev.hellocoop.workers.dev/

@dickhardt
dickhardt marked this pull request as ready for review September 6, 2026 13:42
@dickhardt
dickhardt merged commit 09e1074 into main Sep 6, 2026
1 of 2 checks passed
@dickhardt
dickhardt deleted the cloudflare branch September 6, 2026 13:42
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