✨ Publier v1 is live — a polished docs platform built for the open web.
Skip to content

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

Terminal window
publier build

A valid PUBLIER_TOKEN is required. Output goes to ./dist/. The build is deterministic when dependencies are pinned via pnpm-lock.yaml.

Preview locally

Terminal window
pnpm run preview

Serves 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-lockfile
Build command: publier build
Output directory: dist

Add PUBLIER_TOKEN to your Pages project’s environment variables.

Netlify

Netlify ships pnpm in the build image; just point both commands at it.

netlify.toml
[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-lockfile
Build command: publier build
Output directory: dist

Add PUBLIER_TOKEN to the project’s environment variables.

GitHub Pages

.github/workflows/deploy.yml
name: Deploy
on:
push:
branches: [main]
permissions:
contents: read
pages: write
id-token: write
jobs:
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@v4

Set site and base in astro.config.ts when hosting under a subpath (e.g. https://<user>.github.io/<repo>/).

nginx / Docker

Dockerfile
FROM nginx:alpine
COPY dist/ /usr/share/nginx/html/
Terminal window
docker build -t my-docs .
docker run -p 8080:80 my-docs

Cache headers

Hashed assets in dist/_astro/ are safe to cache aggressively:

Cache-Control: public, max-age=31536000, immutable

HTML files should have shorter TTLs so content updates roll out quickly:

Cache-Control: public, max-age=60

For Cloudflare Pages and Netlify, drop a public/_headers file with these rules and the host applies them automatically.