Skip to content

Deploying documentation

The docs site lives in docs/ and is built with VitePress.

Local development

bash
pnpm install
pnpm docs:dev      # http://localhost:5173/
pnpm docs:build    # static output → docs/.vitepress/dist
pnpm docs:preview  # preview production build

Cloudflare Pages

The VitePress config uses base: "/" for a Cloudflare Pages project named mastra-effect at https://mastra-effect.pages.dev.

bash
pnpm docs:build
pnpm docs:deploy   # wrangler pages deploy docs/.vitepress/dist --project-name=mastra-effect

Requires Wrangler and a Cloudflare account. Authenticate with wrangler login or set CLOUDFLARE_API_TOKEN and CLOUDFLARE_ACCOUNT_ID.

SettingValue
Build commandpnpm docs:build
Output directorydocs/.vitepress/dist
Node version20+

GitHub Actions: .github/workflows/docs-pages.yml deploys on pushes to main when CLOUDFLARE_API_TOKEN and CLOUDFLARE_ACCOUNT_ID repository secrets are configured.

Other static hosts

If the site is served from a subpath (for example GitHub Pages project sites), set base in docs/.vitepress/config.ts to that path (for example "/mastra-effect/").

Library development

bash
pnpm typecheck
pnpm test
pnpm build