This docs site
The site is built with VitePress from the docs/ folder of toneflix/collab-api.
Work on it
cd docs
yarn install
yarn dev # http://localhost:5173
yarn build # static site in docs/.vitepress/dist
yarn preview # serve the buildPages are Markdown. Add new ones to the sidebar in docs/.vitepress/config.mts.
Host it on Cloudflare Pages
The repository is private, so GitHub Pages would need a paid GitHub plan. Instead, the Docs workflow (.github/workflows/docs.yml) builds the site and deploys it to Cloudflare Pages, which is free.
- Pull requests that change
docs/only build the site, so broken pages or links fail the check. - Pushes to
mainthat changedocs/build and deploy it. You can also run it by hand from the Actions tab.
One-time setup
- In Cloudflare, create an API token under My Profile > API Tokens > Create Token > Custom token with the Account > Cloudflare Pages > Edit permission.
- Copy your Account ID from the right side of the Workers & Pages overview.
- In GitHub, under Settings > Secrets and variables > Actions, add the repository secrets
CLOUDFLARE_API_TOKENandCLOUDFLARE_ACCOUNT_ID. - Optional: add a repository variable
CLOUDFLARE_PAGES_PROJECTto change the project name. It defaults totoneflix-collab-docs, so the site is served athttps://toneflix-collab-docs.pages.dev.
The first deploy creates the Pages project. Add a custom domain to it in Cloudflare under the project's Custom domains tab.
Keep it private
These pages describe webhooks, admin commands and setup, so you may not want them public. With Cloudflare Zero Trust > Access, add a self-hosted application for the Pages domain and allow your team's emails. It is free for up to 50 users. People sign in with a one-time code sent to their email.
Serving under a sub-path
The site expects to be served from the root of its domain. To serve it under a path, such as /docs/, build with DOCS_BASE=/docs/ yarn build.