Skip to content

feat(web): migrate hosting to Cloudflare Pages#205

Merged
charlesgreen merged 2 commits into
mainfrom
feat/web-cloudflare-pages-migration
May 2, 2026
Merged

feat(web): migrate hosting to Cloudflare Pages#205
charlesgreen merged 2 commits into
mainfrom
feat/web-cloudflare-pages-migration

Conversation

@charlesgreen
Copy link
Copy Markdown
Contributor

@charlesgreen charlesgreen commented May 2, 2026

Summary

Migrates aixgo.dev hosting to Cloudflare Pages. Preview verified live at aixgo.pages.dev.

Changes

  • Added: web/static/_headers — cache-control rules for Cloudflare Pages.
  • Removed: legacy hosting and CI config (web/firebase.json, web/.firebaserc, web/cloudbuild.yaml).
  • Updated: CLAUDE.md deployment section to reflect Cloudflare Pages and the required env vars (HUGO_VERSION, HUGO_POSTHOG_KEY, HUGO_POSTHOG_HOST).
  • Bonus fix: reflect.Ptrreflect.Pointer across 4 Go files. govet's inline analyzer flags the deprecated alias and was blocking CI on this PR (and any other PR touching the repo).

Cache policy

  • /css/* and /js/*: max-age=3600, must-revalidate. CSS/JS aren't fingerprinted yet, so we want browsers to revalidate. If we add Hugo resources.Fingerprint later, fingerprinted assets can move to long-cache + immutable.
  • /aixgo-logo.png and /favicon.svg: max-age=31536000, immutable — rarely change.
  • Everything else: Cloudflare Pages defaults.

404 behavior

No _redirects file needed — Cloudflare Pages serves /404.html with HTTP 404 natively.

Test plan

  • cd web && make build — Hugo builds clean.
  • Verified web/public/_headers contains the right rules.
  • go build ./... — compiles after the reflect.Pointer rename.
  • Reviewer: confirm _headers are applied — curl -I https://aixgo.dev/css/main.css should show cache-control: public, max-age=3600, must-revalidate.
  • Reviewer: confirm 404 status — curl -I https://aixgo.dev/this-does-not-exist should return HTTP 404.
  • Reviewer: with HUGO_POSTHOG_KEY set in Cloudflare Pages env vars, confirm a pageview reaches PostHog from aixgo.dev post-cutover.

Removes Firebase Hosting and Google Cloud Build wiring now that
Cloudflare Pages is the production host (preview live at
aixgo.pages.dev). Adds web/static/_headers with the cache policy
ported from firebase.json -- with one fix: CSS/JS no longer carry
the immutable directive because Hugo doesn't fingerprint those
filenames by default, and Firebase Hosting was relying on its own
edge-purge behavior to invalidate stale browser caches. Cloudflare
Pages doesn't auto-purge user CDN/browser caches the same way, so
without this fix returning users could see stale assets for up to
a year after a deploy. Brand images at root keep the long
immutable cache (they rarely change). Updates CLAUDE.md to
document the new deployment path and required env vars (HUGO_VERSION,
HUGO_POSTHOG_KEY, HUGO_POSTHOG_HOST). The Firebase rewrite
"** -> /404.html" is intentionally not ported; Cloudflare Pages
serves /404.html with HTTP 404 natively, which is better SEO than
the HTTP 200 the rewrite produced.
@charlesgreen charlesgreen changed the title feat(web): migrate hosting from Firebase to Cloudflare Pages feat(web): migrate hosting to Cloudflare Pages May 2, 2026
The govet inline analyzer flags reflect.Ptr as a deprecated alias.
reflect.Pointer was introduced in Go 1.18 as the preferred name and
both constants share the same underlying value, so this is a pure
rename. Without the change, golangci-lint blocks merges on every
file that still references reflect.Ptr (10 occurrences across 4
files; the run reports only 3 due to the default
max-same-issues=3 cap).
@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented May 2, 2026

Deploying aixgo with  Cloudflare Pages  Cloudflare Pages

Latest commit: 0a8a12d
Status: ✅  Deploy successful!
Preview URL: https://597611db.aixgo.pages.dev
Branch Preview URL: https://feat-web-cloudflare-pages-mi.aixgo.pages.dev

View logs

@charlesgreen charlesgreen merged commit 55acbbb into main May 2, 2026
16 checks passed
@charlesgreen charlesgreen deleted the feat/web-cloudflare-pages-migration branch May 2, 2026 13:51
charlesgreen added a commit that referenced this pull request May 3, 2026
The Hugo source for aixgo.dev now lives at https://github.com/aixgo-dev/web.
Cloudflare Pages auto-deploys from there; aixgo.dev verified live and
serving from the new project (PostHog beacon firing, DNS unchanged).

Removes:
- web/ (entire 127-file Hugo source tree, ~34k lines)
- .github/workflows/website.yml (stale Firebase deploy; production was
  already on Cloudflare Pages with auto-build, this workflow had been
  failing on every push since PR #205 removed Firebase auth)

Updates:
- CLAUDE.md: replace 60-line Website section with one-line stub linking
  to the new repo; fix anchor in TOC
- Makefile: drop web-* delegation targets
- README.md: replace "web/ source code" references with links to
  aixgo-dev/web; add aixgo-dev/aixgate to the Resources block
- .gitleaks.toml: drop web/content/examples/ allowlist path

Net: -34,696 / +8 lines.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
charlesgreen added a commit that referenced this pull request May 3, 2026
The Hugo source for aixgo.dev now lives at https://github.com/aixgo-dev/web.
Cloudflare Pages auto-deploys from there; aixgo.dev verified live and
serving from the new project (PostHog beacon firing, DNS unchanged).

Removes:
- web/ (entire 127-file Hugo source tree, ~34k lines)
- .github/workflows/website.yml (stale Firebase deploy; production was
  already on Cloudflare Pages with auto-build, this workflow had been
  failing on every push since PR #205 removed Firebase auth)

Updates:
- CLAUDE.md: replace 60-line Website section with one-line stub linking
  to the new repo; fix anchor in TOC
- Makefile: drop web-* delegation targets
- README.md: replace "web/ source code" references with links to
  aixgo-dev/web; add aixgo-dev/aixgate to the Resources block
- .gitleaks.toml: drop web/content/examples/ allowlist path

Net: -34,696 / +8 lines.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
charlesgreen added a commit that referenced this pull request May 3, 2026
The Hugo source for aixgo.dev now lives at https://github.com/aixgo-dev/web.
Cloudflare Pages auto-deploys from there; aixgo.dev verified live and
serving from the new project (PostHog beacon firing, DNS unchanged).

Removes:
- web/ (entire 127-file Hugo source tree, ~34k lines)
- .github/workflows/website.yml (stale Firebase deploy; production was
  already on Cloudflare Pages with auto-build, this workflow had been
  failing on every push since PR #205 removed Firebase auth)

Updates:
- CLAUDE.md: replace 60-line Website section with one-line stub linking
  to the new repo; fix anchor in TOC
- Makefile: drop web-* delegation targets
- README.md: replace "web/ source code" references with links to
  aixgo-dev/web; add aixgo-dev/aixgate to the Resources block
- .gitleaks.toml: drop web/content/examples/ allowlist path

Net: -34,696 / +8 lines.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant