Skip to content

Deploying Docs to Cloudflare Pages

AramDungeons docs deploy automatically through .github/workflows/deploy-docs.yml. Pushes that touch docs/ build Astro/Starlight site, then upload docs/dist to Cloudflare Pages.

One-Time Cloudflare Setup

  1. Create Cloudflare Pages project named aramdungeons-docs.
  2. In GitHub repo settings, add secret CLOUDFLARE_API_TOKEN.
  3. Add secret CLOUDFLARE_ACCOUNT_ID.

Token should have at least these permissions:

  • Cloudflare Pages:Edit
  • Account Settings:Read

Build Details

  • Workflow installs Bun 1.1.20 because docs app pins that package manager version.
  • Build command is bun run build.
  • Astro outputs static files to docs/dist.
  • Static Astro/Starlight deploy does not need Cloudflare adapter.

Branch Behavior

  • Pushes to default production branch deploy production docs.
  • Pushes to other branches deploy branch previews because workflow passes --branch=${github.ref_name} to Wrangler.

If Project Name Differs

Edit this line in workflow:

command: pages deploy docs/dist --project-name=aramdungeons-docs --branch=${{ github.ref_name }}

Replace aramdungeons-docs with real Cloudflare Pages project name.