Deployment
Deploy a Publier site to any static host — Cloudflare Pages, Netlify, Vercel, GitHub Pages, or your own server.
A Publier site is a standard Astro static build. publier build produces HTML, JS, CSS, and assets in dist/ — deploy that directory to any static host.
Build
publier buildA valid PUBLIER_TOKEN is required. Output goes to ./dist/. The build is deterministic when dependencies are pinned via pnpm-lock.yaml.
Preview locally
pnpm run previewServes dist/ on http://localhost:4321 exactly as a production host would.
Cloudflare Pages
No config file required — Cloudflare auto-detects Astro. Override the install command so Cloudflare uses pnpm (it defaults to npm):
Install command: pnpm install --frozen-lockfileBuild command: publier buildOutput directory: distAdd PUBLIER_TOKEN to your Pages project’s environment variables.
Netlify
Netlify ships pnpm in the build image; just point both commands at it.
[build] command = "pnpm install --frozen-lockfile && publier build" publish = "dist"Add PUBLIER_TOKEN as a build secret.
Vercel
Vercel auto-detects Astro. Override the install command so Vercel uses pnpm.
Install command: pnpm install --frozen-lockfileBuild command: publier buildOutput directory: distAdd PUBLIER_TOKEN to the project’s environment variables.
GitHub Pages
name: Deployon: push: branches: [main]permissions: contents: read pages: write id-token: writejobs: build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: pnpm/action-setup@v4 with: { version: latest } - run: pnpm install --frozen-lockfile - run: publier build env: PUBLIER_TOKEN: ${{ secrets.PUBLIER_TOKEN }} - uses: actions/upload-pages-artifact@v3 with: { path: ./dist } deploy: needs: build runs-on: ubuntu-latest environment: { name: github-pages, url: "${{ steps.deploy.outputs.page_url }}" } steps: - id: deploy uses: actions/deploy-pages@v4Set site and base in astro.config.ts when hosting under a subpath (e.g. https://<user>.github.io/<repo>/).
nginx / Docker
FROM nginx:alpineCOPY dist/ /usr/share/nginx/html/docker build -t my-docs .docker run -p 8080:80 my-docsCache headers
Hashed assets in dist/_astro/ are safe to cache aggressively:
Cache-Control: public, max-age=31536000, immutableHTML files should have shorter TTLs so content updates roll out quickly:
Cache-Control: public, max-age=60For Cloudflare Pages and Netlify, drop a public/_headers file with these rules and the host applies them automatically.