Skip to content

Deployment

Build and host your documentation site for production use.

Generate a production build with Astro’s CLI:

Terminal window
npm run build

The compiled files land in dist/. Preview the result locally before deploying:

Terminal window
npm run preview

You can host the static output on any modern provider:

  • Netlify – Drag and drop the dist/ folder or connect your repository for automatic builds.
  • Vercel – Import the repo and select the npm run build command; Vercel handles the rest.
  • GitHub Pages – Commit dist/ to a branch like gh-pages and enable Pages for that branch.
  • Cloudflare Pages – Point to the repo, set npm run build as the build command, and dist as the output directory.

Pick whichever platform best matches your team’s workflow.

Double-check that config.mjs has the correct url so generated <meta> tags reference your production domain. Update favicons in public/ if you want custom icons for browser tabs and social previews.

Most hosts can build directly from the main branch. Add a CI workflow that runs npm ci, npm run build, and then publishes the generated assets. Keeping deploys automated ensures the docs stay in sync with your codebase.