Skip to content

Deploy these docs

This site is built with Astro + Starlight and deploys as static files to Cloudflare Pages. Here’s how to build and ship it yourself.

Terminal window
npm install
npm run dev # http://localhost:4321

Build and preview the production output:

Terminal window
npm run build # outputs to ./dist
npm run preview
Section titled “Option A — Git integration (recommended)”
  1. Push this repo to GitHub/GitLab.
  2. In the Cloudflare dashboard: Workers & Pages → Create → Pages → Connect to Git, and select the repo.
  3. Set the build settings:
    • Framework preset: Astro
    • Build command: npm run build
    • Build output directory: dist
  4. Save and deploy. Every push to your default branch publishes automatically, and pull requests get preview URLs.

Build locally and push the dist/ folder straight to Pages:

Terminal window
npm run build
npx wrangler pages deploy ./dist --project-name imgsqz-docs

The included deploy script wraps both steps:

Terminal window
npm run deploy
  • Static output — Starlight builds plain HTML/CSS/JS, served from Cloudflare’s global edge with no server to run.
  • Built-in search — Starlight bundles Pagefind, which runs fully client-side, so search works on a static host with zero backend.
  • Instant cache invalidation & previews — every deploy is atomic, and PRs get isolated preview URLs.
  • astro.config.mjs — Starlight config (nav, theme, metadata).
  • wrangler.jsonc — Cloudflare project name and the Pages build output dir.
  • public/_headers — long-lived caching for hashed assets, sensible defaults for HTML.

In Pages → your project → Custom domains, add your domain and follow the DNS prompt. Cloudflare provisions TLS automatically.