← knowledge.oriz.in

Cloudflare Pages — branch deploys mitigation for 100-project limit

runbook runbookcloudflare-pagesdeployslimitsenvironments

CF Pages branch deploys — 100-project mitigation

Problem

Cloudflare Pages free tier caps at 100 projects per account. If each app × each environment got its own project, the family would quickly blow past the limit (26 apps × 3 envs = 78 projects, plus per-PR previews = explosion).

Solution

One CF Pages project per app. All environments live inside that single project as branch deploys. 26 apps → 26 projects, well under the 100 ceiling, with infinite preview headroom.

Branch → environment mapping

Branch Environment URL
main Production Custom domain (<app>.oriz.in)
staging Staging staging.<project>.pages.dev
pr/<number> Preview Auto-generated <hash>.<project>.pages.dev

Per-project CF Pages config

For each app's CF Pages project:

1. Connect the repo

2. Production branch

3. Preview branches

4. Staging alias

5. Environment variables per branch

Workflow per developer

# Local dev
git checkout -b feat/new-thing
git push origin feat/new-thing
# → auto-preview at https://<hash>.<project>.pages.dev

# Promote to staging
git push origin feat/new-thing:staging
# → staging.<project>.pages.dev

# Promote to prod
gh pr merge --merge --branch feat/new-thing
# → main branch deploys to <app>.oriz.in

Capacity ledger

| Total apps | 26 | | CF Pages projects used | 26 (1 per app) | | Free tier ceiling | 100 | | Headroom | 74 |

Headroom is enough for 74 more apps before we'd need to consolidate. At current growth rate (~10 apps/year), that's ~7 years of runway.

When to break the rule

If a single app needs more than 3 active long-lived branches (e.g. main + staging + canary + beta), it gets its own preview-only sub-project. Doesn't apply today for any app.

Cross-refs