Task-7: Cloudflare Pages Deployment + DNS Migration Plan
Section titled “Task-7: Cloudflare Pages Deployment + DNS Migration Plan”Date: 2026-05-20 Status: Ready to execute (requires Talbot’s CLOUDFLARE_API_TOKEN)
What’s Already Built
Section titled “What’s Already Built”sites/ts/deploy.sh— identical pattern to mbr/sdc deploys; handles build + wrangler deploysites/ts/.env.example—CLOUDFLARE_PAGES_PROJECT_NAME=ts-site- CF Pages project name will be
ts-site→ expectts-site.pages.devorts-site-<suffix>.pages.dev
Deployment Steps (Cloudflare Pages)
Section titled “Deployment Steps (Cloudflare Pages)”Step 1 — Set API token
Section titled “Step 1 — Set API token”# In sites/ts/.env.local (gitignored)CLOUDFLARE_API_TOKEN=<your-token>Token needs Cloudflare Pages: Edit permission. Reuse the token already used for mbr/sdc.
Step 2 — First deploy
Section titled “Step 2 — First deploy”cd /home/ta/projects/monorepo/sites/ts./deploy.shThis will:
- Build + Pagefind index
- Create the
ts-sitePages project (if new) - Deploy
dist/to Cloudflare
Note the pages.dev subdomain assigned — it cannot be changed after creation.
Step 3 — Add custom domain in CF dashboard
Section titled “Step 3 — Add custom domain in CF dashboard”- Go to: Cloudflare dashboard → Pages →
ts-site→ Custom domains - Add
talbotstevens.comandwww.talbotstevens.com - CF will prompt for DNS changes
DNS Migration Plan (Canadian Web Hosting → Cloudflare)
Section titled “DNS Migration Plan (Canadian Web Hosting → Cloudflare)”Current state (Canadian Web Hosting)
Section titled “Current state (Canadian Web Hosting)”- Registrar: unknown — check at
whois talbotstevens.com - NS: Canadian Web Hosting nameservers
- Hosting: Windows IIS (legacy site)
Target state
Section titled “Target state”- Hosting: Cloudflare Pages (
ts-siteproject) - DNS managed by: Cloudflare (add domain to CF account, point NS)
- Registrar: leave where it is initially; migrate later if desired
Migration sequence
Section titled “Migration sequence”Option A — Full NS transfer to Cloudflare (recommended)
- Add
talbotstevens.comto Cloudflare account (free plan is fine) - CF scans current DNS and imports records — review before saving
- At registrar: change nameservers to the two CF nameservers CF assigns
- DNS propagates (minutes to 24h depending on registrar)
- In CF: add
talbotstevens.comas custom domain onts-sitePages project - CF auto-provisions SSL cert
Option B — CNAME record only (if NS transfer not possible)
Some registrars block apex CNAME. CF Pages requires apex domain → use Option A.
DNS records to preserve (before cutover)
Section titled “DNS records to preserve (before cutover)”Check existing records using:
dig talbotstevens.com ANYdig www.talbotstevens.comdig mail.talbotstevens.com # if email existsdig _dmarc.talbotstevens.comCommon records to carry over:
- MX records (email — critical, do not lose)
- SPF/DKIM TXT records (email deliverability)
- Any CNAME/A records for subdomains (e.g. webmail, ftp)
Zero-downtime cutover
Section titled “Zero-downtime cutover”- Deploy to CF Pages, confirm at
ts-site.pages.dev - Add domain to CF, set up SSL, test at pages.dev first
- Lower TTL on existing DNS records to 300s (5 min) — do 24h before cutover
- Transfer NS to CF — old site still serves until TTL expires
- After propagation confirmed: set TTL back to 3600s
Email consideration
Section titled “Email consideration”If talbotstevens.com has active email (e.g. MX → Canadian Web Hosting):
- Must preserve MX records in Cloudflare DNS before flipping NS
- Use
dig MX talbotstevens.comto capture current MX targets - Add them verbatim in CF DNS before NS cutover
Post-Deploy Checklist
Section titled “Post-Deploy Checklist”-
https://talbotstevens.comloads — HTTP → HTTPS redirect -
https://www.talbotstevens.comloads and redirects to apex (or vice versa) - All 11 pages return 200
- Pagefind search works (modal opens, results appear)
- Gross-Up Calculator iframe loads at
/gross-up - Dark mode toggle persists across navigation
- Security headers present (
curl -I https://talbotstevens.com) - Email still works (send test email to tstevens@talbotstevens.com if active)
Ongoing Deploys (After Initial Setup)
Section titled “Ongoing Deploys (After Initial Setup)”cd /home/ta/projects/monorepo/sites/ts./deploy.shOr add to monorepo root as a pnpm script:
"deploy:ts": "cd sites/ts && ./deploy.sh"