Cloudflare deployment¶
Guidance for repositories deployed to Cloudflare (typically Workers via Wrangler).
Detection evidence¶
The detector recognizes Cloudflare when it finds:
wrangler.toml,wrangler.json, orwrangler.jsoncpackage.jsonscripts mentioningwranglerorcloudflare.github/workflows/*.ymlmentioningwranglerorcloudflare
Recommended profile¶
Cloudflare Workers commonly use the typescript-cloudflare-worker profile.
python3 /path/to/repo-standards/scripts/detect_repo_standard.py --repo .
What should remain repo-specific¶
During and after first migration, keep repo-specific:
- Production deploy workflow — Wrangler deploy steps, environments, and triggers
- Wrangler configuration —
wrangler.toml/wrangler.jsoncbindings, routes, compatibility flags - Cloudflare secrets — stored in Cloudflare, not in the repository
- Custom build steps — bundler config, asset uploads, Durable Objects migrations
The standards repo provides CI and governance templates, not a replacement deploy pipeline.
What standards still apply¶
Even with repo-specific deploy workflows, adopt:
.repo-policy.ymlwithtypescript-cloudflare-workerprofile- AI/editor rules via Rulesync
- Semantic PR, AI rules check, docs check, secret scan workflows
- Dependabot
.gitignoreusingtemplates/gitignore/cloudflare-worker.gitignore.env.examplewith comments that production secrets belong in Wrangler/Cloudflare
First migration PR — do not change¶
- Do not alter production deploy behavior
- Do not modify
wrangler.tomlbindings or routes for standards adoption - Do not commit Wrangler secrets or API tokens
- Do not replace existing deploy workflows — add standards workflows alongside them
Suggested follow-up improvements¶
After the first migration PR merges:
- Pin Wrangler version in CI and document in
.repo-policy.ymlcommands - Add deploy workflow documentation to
README.md - Consider reusable
node-ciworkflow from repo-standards - Review
.env.example.cloudflaretemplate for missing variables - Evaluate devcontainer template at
templates/devcontainer/cloudflare-worker/
Secrets¶
Keep Wrangler secrets in Cloudflare (via wrangler secret put or the Cloudflare dashboard). Never commit secrets to the repository or .env files.