Build and Deployment
Cloudflare Pages project settings
| Setting | Value |
|---|---|
| Source | GitHub pmgasset/fortadamswebsite, production branch main |
| Framework preset | None / Next.js (Static HTML Export) |
| Build command | npm run build |
| Build output directory | out |
| Node version | 20+ (set NODE_VERSION if the default is older) |
| Functions | Auto-detected from the root functions/ directory |
- Production deploys: every push to
main, including every Decap publish. - Preview deploys: every other branch and PR gets a unique
*.pages.devURL. Preview uses the Preview environment's variables. Set theGHL_*secrets there too, ideally pointing at a test pipeline.
Environment variables
Configure them under Workers & Pages → project → Settings → Variables and Secrets. NEXT_PUBLIC_* values are compiled into the JavaScript bundle, so changing one requires a redeploy. The GHL_* secrets are read by the Function at request time. Full list: Reference → Environment Variables.
Deploying
- Normal: merge or push to
main, then watch Deployments. - Rebuild without code changes (for example, to drop past events or pick up a changed env var): Deployments → latest production deployment → ⋯ → Retry deployment.
- Roll back: Deployments → a previous successful deployment → ⋯ → Rollback to this deployment. This is instant. Remember that the next push to
maindeploys the currentmainagain, so also revert the bad commit.
Scheduled rebuilds (recommended)
Because "upcoming" events are computed at build time, schedule a daily rebuild:
- Pages → Settings → Builds → Deploy hooks: create a hook for
mainand copy its URL. Treat it as a secret. - Call it daily just after midnight Eastern, from a Cloudflare Worker Cron Trigger (
curl -X POST <hook>) or a GitHub Actionsscheduleworkflow.
This hasn't been set up yet; it's tracked in Known Issues and Open Items.
Redirects and headers
public/_redirectsis copied toout/_redirectsand applied by Pages. It currently has one rule (/preservation/restoration-projects/→/history/#restoration-projects, 301) plus commented, guessed examples. Populate it from a crawl of the old WordPress site before DNS cutover.- There's no
_headersfile. Security headers (CSP, HSTS, etc.) aren't configured at the Pages level. If you add a CSP, allowfareharbor.com,cdn.r2.fortadams.org,crm.fortadams.org, the HighLevel webhook hosts,www.google.com(map iframe), andunpkg.com(for/adminonly).
Domains
The production canonical URL is siteConfig.url (https://www.fortadams.org), used for metadataBase, the sitemap, and robots. Attach both apex and www under Pages → Custom domains and redirect one to the other. Confirm the final domain before launch; it's still marked [PLACEHOLDER].
No comments to display
No comments to display