Skip to content

Publish docs with Cloudflare Pages

The docs site is a static Astro/Starlight project in docs-site/. Deploy it with Cloudflare Pages, not a Worker or Tunnel. Pages serves the generated files; it does not host or change the SDK’s npm package registry.

  1. In Cloudflare, open Workers & Pages → Create application → Pages → Connect to Git.
  2. Authorize the Cloudflare GitHub app to access Social-Pulse-CRM/Crawler, which is a private repository.
  3. Select main as the production branch.
  4. Set the root directory to docs-site, the build command to npm run build, and the build output directory to dist.
  5. Keep Protect with Cloudflare Access disabled so the documentation remains public. Preview deployments may be enabled.
  6. Deploy once to the generated *.pages.dev address and check the site before adding the custom domain.

The docs-site directory must exist in the Git commit Cloudflare clones. If the build reports Cannot find cwd: .../docs-site, the configured root directory is missing from that branch/revision. Commit and push the site first, then retry. Do not use the Workers build form with npx wrangler deploy; it requires a Worker configuration and is not the static Pages build.

  1. In the Pages project, open Custom domains → Set up a domain and enter docs.bug-fence.com.
  2. If the bug-fence.com zone is active in the same Cloudflare account, follow the Pages prompt to create/verify the docs CNAME. If DNS is hosted elsewhere, create the exact CNAME target Pages displays at the authoritative DNS provider.
  3. Do not change the apex (bug-fence.com) DNS records or nameservers for this subdomain.
  4. Wait for the domain to validate and the TLS certificate to become active; then confirm https://docs.bug-fence.com/ loads and the sitemap and llms.txt are reachable.

Remove only the Pages custom-domain binding and the docs CNAME to roll back. Leave the marketing site’s DNS records untouched.