The site in apps/docs/ is an Astro Starlight docs site. It builds to static files, deploys to Cloudflare Pages, and is served at https://boringstack.xyz.
This file documents the wire-up so future-you (or a teammate) can rebuild it from scratch if needed.
-
Cloudflare account. Use the same one that owns the
boringstack.xyzDNS zone. -
Create a Pages project.
- Cloudflare dashboard → Workers & Pages → Create application → Pages → Connect to Git.
- Authorize the
boringstack-xyzGitHub org. - Select the monorepo (docs root:
apps/docs). - Project name:
boringstack-docs(becomes the*.pages.devsubdomain).
-
Build settings.
Setting Value Production branch mainFramework preset Astro Build command bun run build:ciBuild output directory distRoot directory apps/docsNode version 24(via.nvmrc)Environment variables (none) -
Custom domain.
- Pages project → Custom domains → Set up a custom domain →
boringstack.xyz. - Cloudflare auto-creates the DNS CNAME (zone is already on Cloudflare).
- Cert is provisioned automatically; usually live in under a minute.
- Add
www.boringstack.xyzthe same way if desired (redirect handled in the CF dashboard).
- Pages project → Custom domains → Set up a custom domain →
cd apps/docs
bun install
bun run dev # local preview at http://localhost:4321
bun run build:site # produces dist/ (Cloudflare uses this; no sibling templates needed)
bun run build:ci # check:docs-data + build; same as docs-linkcheck CI
bun run preview # serves dist/ at http://localhost:4321The build runs Pagefind automatically (Starlight bundles it), so search works on the built site too.
- Push to
main→ Cloudflare auto-builds withbun run build:ci(docs-data freshness check + build + fragment-link gate). The committed JSON insrc/data/is the catalog source of truth; the check fails the deploy when it drifts fromapps/api/apps/ui, instead of silently serving stale catalogs. From the monorepo checkout the sibling defaults resolve without extra env vars. - Manual production deploy:
bun run deployrunsbuild:ci(docs-data check + build) beforewrangler deploy. From the monorepo, defaults useapps/uiandapps/api(override withBORINGSTACK_UI_DIR/BORINGSTACK_API_DIR). - Pushes to other branches → preview deployment at
<branch>.boringstack-docs.pages.dev. - PRs from forks get preview deployments too (CF Pages comments the URL on the PR).
- Rollback: Pages dashboard → Deployments → pick a previous deployment → Rollback.
- No CNAME file. Unlike GitHub Pages, Cloudflare Pages binds the custom domain via the dashboard, not via a
public/CNAMEfile. Adding one would just serve/CNAMEas text. - Sitemap. Starlight generates
sitemap-index.xmlandsitemap-0.xmlduringbun run build. Pagefind plus the sidebar remains the primary human navigation. - Analytics. Not wired up. If you add Cloudflare Web Analytics later, drop the
<script>intoastro.config.mjsvia Starlight'sheadoption.