Skip to content
Portfolio

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.


Connect the GitHub repository in Workers & Pages → Create → Pages → Connect to Git:

SettingValue
Framework presetAstro
Build commandpnpm run build
Build output directorydist
Root directory/ (repository root)
Node.js version22

Cloudflare detects pnpm-lock.yaml and runs pnpm install before the build. The package.json engines field pins Node >=22.


git push → Cloudflare webhook → pnpm install → pnpm run build → dist/ uploaded → live

Each push to the production branch triggers a new deployment. Cloudflare also builds preview deployments for other branches.


Terminal window
pnpm install
pnpm dev # http://localhost:4321
pnpm build # output to dist/
pnpm preview # serve production build locally

Use pnpm dev while writing content. Run pnpm build before merging if you want to catch build errors locally.


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.


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.