Skip to content

Deploy to Cloudflare (Workers static assets) - #62

Open
janispritzkau wants to merge 1 commit into
mainfrom
deploy/cloudflare
Open

janispritzkau wants to merge 1 commit into
mainfrom
deploy/cloudflare

Conversation

@janispritzkau

Copy link
Copy Markdown
Owner

Part 3/3 of #54. Based on #61.

  • wrangler.jsonc: Cloudflare Workers static assets serving dist/
  • public/_headers: immutable caching for /assets/*, nosniff/referrer headers (HTML, service-worker.js and the manifest keep Cloudflare's default revalidation)
  • deploy job in the CI workflow: pushes to main → wrangler deploy; same-repo PRs → wrangler versions upload (preview URL). Fork PRs skip it.
  • README deployment section

Before merging (needs your input)

  1. Add repo secrets CLOUDFLARE_API_TOKEN (Workers Scripts: Edit) and CLOUDFLARE_ACCOUNT_ID.
  2. Add repo variables VITE_API, VITE_GOOGLE_CLIENT_ID, VITE_DISCORD_CLIENT_ID (they're baked in at build time).
  3. The deploy job fails until 1 is done, and the PR-preview step needs the worker to exist first, so the first main deploy should happen before relying on previews.
  4. Domain cutover for loopover.xyz is intentionally not enabled; the routes entry in wrangler.jsonc is commented out.

Tested

npm run build && npx wrangler dev: / 200, assets get immutable, 404s for unknown paths, headers applied, SW registers and the game renders in the browser. The deploy job itself is untested (no Cloudflare credentials here).

Cloudflare redirects /oauth-callback.html → /oauth-callback with the query string preserved (verified via curl). The callback page only uses location.search, so the OAuth flow should be unaffected, and registered redirect URIs don't need to change. I couldn't exercise the popup flow end to end.

Written by Claude Sonnet 5.5 (Claude Code) on behalf of Janis

🤖 Generated with Claude Code

@janispritzkau
janispritzkau added this pull request to stack #63 November 5, 2026 19:36
Base automatically changed from chore/ci-and-hygiene to main November 5, 2026 19:48
Add wrangler.jsonc, cache/security headers, and a CI deploy job: pushes to main
deploy, same-repo PRs upload a preview version.

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

This branch had an error being deployed

1 failed deployment
preview — 42280afe Deployed Nov 5, 2026 by janispritzkau via deploy #4
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