Deploying Ryze using Cloudflare Pages
23 Nov 2025
2 min read
Build and Preview
Run the production build locally and preview the build output.
npm run build
npm run preview
npm run build runs astro build and outputs a static dist/ directory. Preview checks that files render as expected before pushing to production.
Recommended Hosts and Setup
Cloudflare Pages (Recommended)
- Connect your GitHub repo to Pages.
- Build command:
npm run build. - Build output directory:
dist. - Configure environment variables in the Pages dashboard. Do not commit secrets.
- Cloudflare Pages serves the
dist/content from the edge. You get global caching and TLS automatically.
Vercel
- Auto-detects Astro in your Github repos.
Netlify
-
Build command:
npm run build -
Publish directory:
dist -
Add
netlify.tomlif you need redirects or headers. See example below.[build] command = "npm run build" publish = "dist" [[redirects]] from = "/api/\*" to = "/.netlify/functions/:splat" status = 200 [[headers]] for = "/\*" [headers.values] Cache-Control = "public, max-age=0, s-maxage=60"
Recommendations
Image Optimization
For editorial images, use @astrojs/image or process images during build (generate WebP/AVIF and multiple sizes). If you don’t need dynamic optimization, place images in /public and serve them directly.
Environment Variables and Secrets
Use .env for local development; add production secrets in the host UI (Pages, Netlify, Vercel).
Prefix variables exposed to client-side code with PUBLIC_ (e.g., PUBLIC_ANALYTICS_ID). Do not commit private keys.
Post-Deploy Monitoring
After your site goes live, track performance and usage:
- Use host analytics or Plausible/Google Analytics to monitor traffic.
- Consider Lighthouse or PageSpeed checks for performance metrics. Automate with Lighthouse CI if desired.
For future updates to Ryze, pull the latest changes from the main branch and redeploy. Happy deploying!