Cloudflare Pages Deployment
The documentation site is a static Astro + Starlight project. The portfolio is built using Astro Vanilla. Both are deployed as separate Cloudflare Pages projects from the same repository. The build produces HTML, CSS, JavaScript, and assets under dist/. Nothing runs server-side in production.
Cloudflare dashboard
Section titled “Cloudflare dashboard”Connect the GitHub repository in Workers & Pages → Create → Pages → Connect to Git:
| Setting | Value |
|---|---|
| Framework preset | Astro |
| Build command | pnpm run build |
| Build output directory | dist |
| Root directory | / (repository root) |
| Node.js version | 22 |
Cloudflare detects pnpm-lock.yaml and runs pnpm install before the build. The package.json engines field pins Node >=22.
Deploy pipeline
Section titled “Deploy pipeline”git push → Cloudflare webhook → pnpm install → pnpm run build → dist/ uploaded → liveEach push to the production branch triggers a new deployment. Cloudflare also builds preview deployments for other branches.
Local development
Section titled “Local development”pnpm installpnpm dev # http://localhost:4321pnpm build # output to dist/pnpm preview # serve production build locallyUse pnpm dev while writing content. Run pnpm build before merging if you want to catch build errors locally.
Rollback
Section titled “Rollback”In the Cloudflare Pages dashboard, every deployment is versioned. To revert a bad release, open the project → Deployments → select a previous successful build → Rollback to this deployment.
Environment variables
Section titled “Environment variables”This project does not require runtime secrets on Pages — the site is fully static. If a future static site needs build-time variables (e.g. analytics IDs), add them under Settings → Environment variables in the Pages project. They are injected during the build step only.