Phase 0 deploy — static export Next.js → Cloudflare Pages via git integration.
Live (Phase 0): https://arno-ijr.pages.dev (opens in a new tab)
Key gotcha (2026)
Cloudflare merged the "Workers & Pages" UI. Through Create application you land in a Worker-like flow with minimal fields. But for a static site you still need a Pages-style wrangler.jsonc at the repo root:
{
"$schema": "node_modules/wrangler/config-schema.json",
"name": "arno",
"compatibility_date": "2026-05-20",
"pages_build_output_dir": "./apps/web/out"
}Do not set assets.directory (that's for pure Workers with static assets — a different project type).
One-time setup
- Log in to the Cloudflare dashboard → Workers & Pages → Create application → Pages → Connect to Git
- Pick the GitHub account
<old-github-user>→ repoarno - Project name:
arno(givesarno.pages.dev; if taken —arno-appor similar) - Branch:
main - Build settings:
- Framework preset: None (not the Next.js preset — we run the static export ourselves)
- Build command:
corepack enable && pnpm install --frozen-lockfile && pnpm --filter @arno/web build - Build output directory:
apps/web/out - Root directory: (leave empty = repo root)
- Environment variables:
NODE_VERSION=20PNPM_VERSION=11.1.3
- Save and Deploy
After the first deploy
- Public URL appears:
https://arno.pages.dev(or whichever was assigned) - Subsequent push to
main→ auto-rebuild + redeploy - Preview deploys per PR — enabled by default
Custom domain (post-MVP)
Per master spec §III.2.9 — Porkbun as separate registrar. DNS TTL 300s. Connecting the domain → Pages comes later (Phase 16).
SPOF mitigation (master spec §III.2.9)
Immediately after the first deploy:
- Add a second admin to the Cloudflare account (hardware key 2FA)
- Save the CF API token in 2 password manager backups
- Document in
docs/runbooks/cloudflare_account_loss.md(Phase 16)
Troubleshooting
Build fails with "pnpm: command not found":
- Check the
PNPM_VERSIONenv var - Alternative:
npm install -g pnpm@11.1.3 && pnpm install && pnpm build
Static export output empty:
- Check that
next.config.mjshasoutput: "export" apps/web/out/index.htmlmust exist afterpnpm --filter @arno/web build
404 on routes:
trailingSlash: trueinnext.config.mjs— required for static export
When to change the deploy strategy
Static export is enough through Phase 8 (introduce Auth). Phase 8-9 — switch to:
- Option A:
@cloudflare/next-on-pagesadapter — Edge runtime - Option B: Workers Static Assets with OpenNext — more modern, closer to Vercel
The decision lands in Phase 8 after assessing the ecosystem (2026).