Publishing a Knowledge Base¶
Every FreeDocStore knowledge base follows the same lifecycle: plan → repo → build → deploy → register.
Lifecycle¶
- Plan. Turn a topic into a concrete plan: KB id (slug), repo name, Cloudflare Pages project, production URL, first pages. The MCP
publish_plantool generates this plan without creating anything. - Repo. Create a public GitHub repo under the
FreeDocStoreorg named after the KB id, following the Zensical repo contract. - Build. GitHub Actions installs Zensical and runs
python -m zensical build --strict, producing static HTML insite/(never committed). - Deploy. The workflow deploys
site/to the Cloudflare Pages project named after the KB id, using the FreeDocStore org-level Actions secrets. - Register. Add the KB to
site/registry.jsonin the platform repo so the product site, MCP server, and agents can discover it.
The deploy workflow¶
Each KB repo carries .github/workflows/deploy.yml, triggered on push to main (and manual dispatch):
- Checkout, set up Python 3.12.
python -m pip install zensicalpython -m zensical build --strict— strict mode fails the build on broken links or config errors.-
Source metadata injection — a Node script stamps every generated HTML page with:
<meta name="source-repo" content="FreeDocStore/<kb-id>"> <meta name="source-path" content="docs/<page>.md">This maps each published page back to its Markdown source, which is what makes published pages agent-readable and editable from the Chrome extension.
-
wrangler pages deploy site --project-name=<kb-id>viacloudflare/wrangler-action.
The Cloudflare step is conditional on CLOUDFLARE_API_TOKEN and CLOUDFLARE_ACCOUNT_ID being available. These are org-level Actions secrets on the FreeDocStore GitHub org, visible to public repositories — a new public KB repo inherits them with no per-repo setup. If they are missing, the workflow prints a notice and skips deployment instead of failing.
Publishing checklist¶
- Repo created under
FreeDocStore/<kb-id>, public -
zensical.tomlat root withsite_urlset to the production URL -
docs/index.mdplus topic pages, listed innav -
.github/workflows/deploy.ymlcopied from an existing KB with--project-name=<kb-id> -
.gitignoreexcludessite/,.cache/,__pycache__/ - Cloudflare Pages project
<kb-id>exists (first deploy creates the production branch) - Actions run is green and the site answers at
https://<kb-id>.pages.dev/ - Registry entry added to
site/registry.jsonin the platform repo
Updating a published KB¶
Push to main — or merge a proposal PR — and the same workflow rebuilds and redeploys. There is no separate publish step. Agents can propose updates through the MCP update_files tool, which opens a reviewable PR by default.
Custom domains¶
Each KB's Pages project can attach custom domains; the registry records them in cloudflare.custom_domains. Domain automation is not built yet — attaching a domain is currently a manual Cloudflare step.