Skip to content

Cloudflare Pages Deployment & CI/CD Setup

This project is configured for automated, zero-downtime static site deployment on Cloudflare Pages.


  1. Push this repository to GitHub or GitLab.
  2. Visit Cloudflare Dashboard Compute (Workers & Pages) Create Application Pages Connect to Git.
  3. Select your repository Flugel-Physics.
  4. Configure Build settings:
    • Framework Preset: VitePress (or None)
    • Build command: npm run docs:build
    • Build output directory: .vitepress/dist
    • Environment Variables:
      • NODE_VERSION: 20
  5. Click Save and Deploy.

Every subsequent push to main creates an instant production deployment with preview links for pull requests.


2. GitHub Actions Automated Pipeline

The included .github/workflows/pages-deploy.yml workflow automatically builds and publishes the .vitepress/dist output using Cloudflare Wrangler.

Configuration Steps:

  1. In your GitHub repository, navigate to Settings Secrets and variables Actions.
  2. Add the following repository secrets:
    • CLOUDFLARE_API_TOKEN: Cloudflare API token with Account.Cloudflare Pages: Edit permissions.
    • CLOUDFLARE_ACCOUNT_ID: Your Cloudflare account ID (visible in Cloudflare dashboard URL).

3. Local CLI Deployment

To deploy directly from your local terminal using the Wrangler CLI:

bash
# 1. Build the production output
npm run docs:build

# 2. Deploy the built static directory to Cloudflare Pages
npx wrangler pages deploy .vitepress/dist --project-name=flugel-physics