Deploying this docs site
docusaurus build produces a static build/ directory. Deploy it on any static host.
Build
cd marketplace-docs
pnpm install
pnpm sync-spec
pnpm refresh-api
pnpm build
# → build/
Pre-flight check:
pnpm serve # serves build/ on http://localhost:3000
Options
Cloudflare Pages
Mirror the marketplace UI deployment.
npx wrangler pages deploy build --project-name fleapo-docs
Or wire it via the Cloudflare dashboard:
- Connect the repo.
- Build command:
pnpm install && pnpm sync-spec && pnpm refresh-api && pnpm build. - Build output directory:
build/.
Add a wrangler.jsonc for SPA-style routing isn't necessary — Docusaurus emits real HTML for every page.
Vercel
vercel
# Framework preset: Other
# Build command: pnpm sync-spec && pnpm refresh-api && pnpm build
# Output directory: build
# Install command: pnpm install
Or commit a vercel.json:
{
"buildCommand": "pnpm sync-spec && pnpm refresh-api && pnpm build",
"outputDirectory": "build",
"framework": null
}
Netlify
# netlify.toml
[build]
command = "pnpm sync-spec && pnpm refresh-api && pnpm build"
publish = "build"
GitHub Pages
Docusaurus has built-in support:
USE_SSH=true pnpm deploy
# or
GIT_USER=<gh-user> pnpm deploy
Set organizationName and projectName in docusaurus.config.ts first.
S3 + CloudFront
aws s3 sync build/ s3://docs.fleapo.ai/ --delete
aws cloudfront create-invalidation --distribution-id <id> --paths "/*"
Spec sync in CI
The build assumes openapi/marketplace.json exists. Make sure your CI has access to the source spec:
| Source | How |
|---|---|
| Same monorepo / sibling checkout | Ensure CI checks out marketplace-fleapoai-service adjacent to marketplace-docs so scripts/sync-spec.ts finds it |
| Separate repo | Set MARKETPLACE_OPENAPI_PATH env var to an artifact downloaded earlier in the pipeline |
| Live URL | Modify sync-spec.ts to fetch over HTTPS if you publish the spec on a stable URL |
The script exits non-zero if it can't find a spec, failing the build.
Caching
Docusaurus emits content-hashed asset filenames. Set Cache-Control: public, max-age=31536000, immutable on /assets/*. The HTML files should be max-age=300 or shorter.
Search
Local search via @easyops-cn/docusaurus-search-local runs at build time — no runtime dependency. Search index ships with the static output.
Custom domain
Add docs.fleapo.ai (or your domain) as a DNS CNAME to whatever host you're using.