Build and Deploy
Static and server deployment strategies with production checklists.
This page focuses on deployment decisions and production safety checks.
Build mode (notepub build)
notepub build --config ./config.yaml --rules ./rules.yaml --dist ./dist
Build behavior:
- Uses
resolve.jsonfrom artifacts. - Runs
indexautomatically ifresolve.jsonis missing (unless--no-index). - Copies theme assets to
dist/assets. - Copies
sitemap*,robots.txt, andsearch.jsonif present. - Generates minimal sitemap/robots if artifacts are missing.
- Creates
404.html. - Writes redirect pages for
redirect_toroutes.
Serve mode (notepub serve)
notepub serve --config ./config.yaml --rules ./rules.yaml
Serve mode is best when:
- you want live content from S3/local without rebuilding static files
- you run behind a reverse proxy and keep one long-running process
Hosting targets
- GitHub Pages: build output only.
- Netlify/Cloudflare Pages/Vercel static mode: build output only.
- VPS + reverse proxy: use serve mode or static mode.
- S3 static hosting + CDN: build output; strongly set
site.media_base_url.
Production checklist
site.base_urlpoints to the final canonical domain/path.site.media_base_urlis set for static hosting if media assets are external.validatepasses in CI.search.jsonis generated/copied for static search pages.- theme contains
notfound.htmlfor custom 404.
Deploy debugging
If pages render but media is broken on static host, fix site.media_base_url first.
Binary source policy
For reproducible builds in teams and CI:
- pin
NOTEPUB_VERSION(for example,v0.1.3) - download binaries from GitHub Releases instead of using
latest - keep local docs/scripts and CI workflow on the same pinned version