Skip to main content

Docs Deployment

Applies to: Both

Documentation Deployment & Access (Cloudflare)

Overview

  • Static docs site built with Docusaurus under docs/site.
  • Cloudflare Pages deploys preview builds for PRs and production builds on develop/main.
  • Cloudflare Zero Trust (Access) protects the Pages URL; only approved emails/SSO may view.

Local Development

  1. cd docs/site
  2. npm ci
  3. npm run start
  4. Open http://localhost:3000

CI/CD (GitHub Actions → Cloudflare Pages)

  • Workflow file: .github/workflows/docs-pages.yml
  • Required GitHub Secrets:
    • CF_API_TOKEN (Cloudflare API token with Pages:Edit, Pages:Read)
    • CF_ACCOUNT_ID (Cloudflare account ID)
    • CF_PAGES_PROJECT_NAME (Cloudflare Pages project slug)

Cloudflare Pages Setup

  • Create a Pages project (build command npm run build, build dir docs/site/build, working dir docs/site).
  • Connect to this GitHub repo or use the GitHub Action provided.

Zero Trust (Cloudflare Access)

  1. Enable Zero Trust for the Pages domain (or custom domain).
  2. Create an Access Policy:
    • Action: Allow
    • Include: Emails in list (developers) or SSO group
    • Exclude: (optional) Everyone else
  3. (Optional) Create distinct policies for preview vs production URLs.

Preview URLs

  • PRs create preview deployments automatically.
  • You can enforce Access on *.pages.dev or a custom subdomain like docs-preview.example.com.

Docs Linting

  • Workflow: .github/workflows/docs-lint.yml checks for broken links in docs/ on PRs.