Guides / Cloudflare

A quiet Cloudflare Pages workflow with GitHub

Separate projects, predictable builds and a rollback path for small static sites.

REVIEWED · 2026-09-12 · 6 MIN

For a small static site, Cloudflare Pages can watch a dedicated GitHub repository. A push triggers a build, while a failed build leaves the previous deployment online.

Initial setup

  1. Create a separate repository.
  2. Create a new Pages project and select it.
  3. Set the build command to npm run build and output directory to dist.
  4. Add the custom domain only after the first successful build.

When a deployment fails, identify whether installation, building or upload failed before touching DNS.

Leave a useful record

Record the step that actually fixed it, the device or browser version, and any temporary changes you reverted. That note is often more useful than another bookmark.