Deployment
Build and host your documentation site for production use.
Generate a production build with Astro’s CLI:
npm run buildThe compiled files land in dist/. Preview the result locally before deploying:
npm run previewYou 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 buildcommand; Vercel handles the rest. - GitHub Pages – Commit
dist/to a branch likegh-pagesand enable Pages for that branch. - Cloudflare Pages – Point to the repo, set
npm run buildas the build command, anddistas 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.