production-deployment
What production is for sahin.io/angel-investments (Cloudflare Pages behind the sahin.io proxy), what a push to main runs, how public pages are routed and rendered, and how to run the static build locally. Use before touching the deploy workflow, the worker, routing, redirects or static generation, or when asked whether something is live.
- Source file
.claude/skills/production-deployment/SKILL.md
Production and deployment
Moved out of CLAUDE.md on 2026-10-11 (owner: keep CLAUDE.md thin). Shipping a
change is the ship-to-production skill; checking it first is deploy-gate.
Production is Cloudflare Pages (project angel-investments, origin angel-investments-aiq.pages.dev), reached through the sahin.io reverse proxy at https://sahin.io/angel-investments/. Manus (angelport-xm6wmuy7.manus.space) is not production and webdev_save_checkpoint does not deploy.
A push to main runs .github/workflows/deploy-cloudflare.yml: pnpm check → pnpm test → astro build → scripts/astro-postbuild.ts → scripts/validate-public-seo-build.mjs → esbuild of cloudflare/_worker.ts → wrangler pages deploy dist/cloudflare → sahin.io zone purge of the entry points and revoked bundles with a 404 check (scripts/cloudflare-purge.ts, fails the run on failure), plus every client/public file changed in the last 26 hours (logos, backdrops and data JSON keep their URLs and the proxy caches them for a day; that part only warns) → proxy prerender purge (when the PURGE_SALT secret exists) → scripts/verify-live-deploy.ts → IndexNow notification → deletes the run's cloudflare-build cache entry. The build job hands dist/cloudflare + .deploy (~135 MB) to the deploy job through the repo cache (actions/cache/save and restore, key cloudflare-build-{run_id}-{attempt}), never an artifact: the sahin account is on GitHub Free, whose 0.5 GB-month of Actions artifact storage is shared by every repo and accumulates over the month, so per-push artifacts used it up on 2026-10-17 and every deploy failed at "Upload build output" (deleting artifacts does not give used storage back; it resets on the 1st). The repo cache is a separate 10 GB. server/actions-artifact-quota.test.ts guards this.
Actions minutes are the other GitHub Free cap: 2,000 a month across every sahin repo, each job billed rounded up to the minute; when they run out no workflow runs, deploys included, until the 1st. On 2026-10-17 the account had ~314 left with 14 days to go, so the workflows were cut to: two deploy jobs ("Check, test and build", then "Deploy to Cloudflare Pages", ~6 billed minutes per push, down from ~12.5 with the visual run); a newer push cancels an older run's build job, while deploy jobs queue and are never cancelled; pushes that only touch .claude/, docs/ or root *.md do not deploy (paths-ignore); visual regression runs on manual dispatch only, when the owner picks GitHub Actions for a small run (ui-before-after); GSC sync is weekly. Do not split the build job back into parallel jobs or add a push trigger to another workflow without measuring the minutes first. Measure with gh api repos/sahin/<repo>/actions/runs/<id>/jobs (billed = ceil per job). server/actions-minutes-budget.test.ts guards this.
How public pages work
server/seoRouteManifest.tscreateSeoRouteManifest()is the only inventory of public routes;renderRouteHtml()renders each one to static HTML. There is no Express SSR and no SPA fallback.server/publicRouting.tsresolvePublicRequest()is the single (pure) routing decision used by both the Cloudflare worker and the Express dev server (server/publicSite.ts): exact manifest match → canonical 301 for trailing-slash/case variants →/sources/{id}301 straight to the cited source (no page) → legacy redirect → allowlisted asset → true 404.shared/publicUrls.tsbuilds every public path underhttps://sahin.io/angel-investments/:/{company},/{category},/{parent-category}/{subcategory}(parents pinned indata/subcategory-parents.json), investor directories at/{company}/angel-investors,/{category}/angel-investors,/{parent-category}/{subcategory}/angel-investors, the investor index/angel-investorswith firm pages at/angel-investors/{firm},/lists/{list}. When telling the owner about URLs, write them in full (sahin.io/angel-investments/anthropic/angel-investors). Never hand-build a URL; read.claude/skills/public-url-conventions/SKILL.mdbefore adding or changing any route or slug.server/legacyRedirects.tsbuildsdist/cloudflare/legacy-redirect-map.json: an exact map of retired URL families (/category/{slug},/subcategory/{slug},/{slug}-angels-investors,/investors/{slug},/{slug}-funding,/compare/…, market/sector pages, …) to canonical routes, plus the pages that are no longer created (manifest.retired: thin/founder/{slug}and/news/{slug}pages and duplicate Sub-Category directories, removed 2026-10-16) to the closest real page. Owner-reviewed one-off entries live indata/legacy-redirects.json. A redirect whose source becomes a real route is dropped automatically; everything unmapped is a real 404.
Run the static build locally
NODE_ENV=production npx astro build
NODE_ENV=development npx tsx scripts/astro-postbuild.ts # or: pnpm build:cloudflare for both
node scripts/validate-public-seo-build.mjs
npx esbuild cloudflare/_worker.ts --bundle --platform=neutral --target=es2022 --format=esm --outfile=dist/cloudflare/_worker.js
npx wrangler pages dev dist/cloudflare --port 8788 # then curl http://localhost:8788/angel-investments/anthropic