Cloudflare Pages Deployment & CI/CD Setup
This project is configured for automated, zero-downtime static site deployment on Cloudflare Pages.
1. Zero-Config Git Integration (Recommended)
- Push this repository to GitHub or GitLab.
- Visit Cloudflare Dashboard
Compute (Workers & Pages) Create Application Pages Connect to Git. - Select your repository
Flugel-Physics. - Configure Build settings:
- Framework Preset:
VitePress(orNone) - Build command:
npm run docs:build - Build output directory:
.vitepress/dist - Environment Variables:
NODE_VERSION:20
- Framework Preset:
- 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:
- In your GitHub repository, navigate to Settings
Secrets and variables Actions. - Add the following repository secrets:
CLOUDFLARE_API_TOKEN: Cloudflare API token withAccount.Cloudflare Pages: Editpermissions.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