Appearance
Deploying the docs (GitHub Pages / Netlify)
We provide a CI sample for GitHub Pages in .github/workflows/deploy-docs.yml. It builds the VitePress site and publishes docs/.vitepress/dist to gh-pages.
GitHub Pages notes:
- To host at
https://USERNAME.github.io/REPO/, setbase: "/REPO/"indocs/.vitepress/config.ts. - The provided GitHub Action uses
peaceiris/actions-gh-pagesto publish. Set up a branch if your repo uses different publishing rules.
Netlify / Vercel:
- Set the build command to:
pnpm docs:build - Set the publish directory to:
docs/.vitepress/dist
Netlify specifics:
- Engine: Node 18+ (Netlify uses
NODE_VERSIONfromnetlify.tomlor setNODE_VERSIONin site settings) - Use
VITEPRESS_BASE=/if your Netlify site is hosted at a root domain; otherwise addVITEPRESS_BASE=/repo-name/for sub-path deployments (e.g., GitHub Pages). You can set this as a Netlify environment variable in Site settings -> Build & deploy -> Environment. - To keep the
playground/site available for preview builds, configure a[context.deploy-preview]innetlify.tomlwithcommand: pnpm run play:buildandpublish: playground/dist.
Tricks:
- Use
docs:buildin your CI to catch build-time issues early - Keep dev-only assets out of
docs/.vitepress/publicif they are large; instead store them inpublic/and reference by absolute path