1 min read
Deploying static Astro to Cloudflare Pages
From pnpm build to a live URL with custom domain, headers, and cache rules. From pnpm build to a live
- #astro
- #deployment
- #cloudflare
A static Astro site is just a dist/ folder, so any static host works. Cloudflare Pages gets you a global CDN, previews per branch, and a custom domain in one sitting.
Build settings
Point the project at your repo and set:
# build command
pnpm build
# output directory
dist
Custom domain
Add the domain under Custom domains, then create the CNAME record. TLS is automatic.
$ dig +short abagas.web.id
abagas-web-id.pages.dev.
That’s the whole deployment story — no server, nothing to patch on a Tuesday night.