Documentation Publishing¶
Foundry documentation is built with MkDocs and published to a dedicated Cloudflare Pages project. The public URL is routed through the existing Dev Leader project-documentation Worker:
https://www.devleader.ca/projects/foundry/
-> Cloudflare Worker
-> https://nexuslabs-foundry.pages.dev/
No Cloudflare custom domain is required for the Pages project. The Worker owns
the public path on www.devleader.ca.
Versioned API documentation¶
Foundry preserves the same API-documentation model as Needlr:
- pushes to
mainregenerate/api/dev/; - releases generate immutable
/api/v<version>/archives and refresh/api/stable/; gh-pagesacts as the merge store so development and release workflows own separate URL slices without overwriting each other;- the API version switcher reads
/api/versions.json; - Cloudflare receives a trimmed mirror containing main, development, stable, and the newest version archives.
Historical archives remain in gh-pages history even after older versions are
trimmed from the Cloudflare deployment.
The Documentation and Release workflows only merge their owned slices into
gh-pages. A separate Documentation Deployment workflow checks out the
latest merged branch, trims old archives, and deploys that complete snapshot to
Cloudflare. This latest-snapshot deployment prevents concurrent main and
release builds from publishing partial or stale trees.
Safe-by-default deployment¶
The Documentation workflow always builds and uploads the generated site as a GitHub
Actions artifact. Deployment remains disabled until the repository variable
DOCS_DEPLOY_ENABLED is set to true.
This allows documentation changes to merge before Cloudflare credentials or routing are configured without breaking CI or creating public infrastructure.
One-time Cloudflare setup¶
These steps require explicit approval because they create public infrastructure:
- Create the Pages project:
-
Create a protected GitHub environment named
documentationand add these environment secrets: -
CLOUDFLARE_API_TOKEN -
CLOUDFLARE_ACCOUNT_ID -
Set the repository variable:
- Run the
Documentationworkflow frommainwithdeploy=true, or merge a subsequent documentation change tomain.
Dev Leader routing¶
The public path requires changes in ncosentino/devleader-blog:
- Add
"foundry": "nexuslabs-foundry.pages.dev"to the project router'sPROJECT_MAP. - Deploy the
devleader-routerWorker. - Add Foundry to the
/projectscatalog and FAQ. - Add
https://www.devleader.ca/projects/foundry/sitemap.xmltorobots.txt. - Extend the project-page, robots, and live documentation tests.
Adding Foundry to ncosentino/homebase is optional. It only controls whether
Foundry appears on links.devleader.ca; it is not involved in documentation
routing.
Verification¶
Verify each layer in order:
python -m mkdocs build --stricthttps://nexuslabs-foundry.pages.dev/https://www.devleader.ca/projects/foundry/https://www.devleader.ca/projects/foundry/sitemap.xmlhttps://www.devleader.ca/projects/foundry/llms.txt
The public route should preserve canonical URLs, social metadata, sitemap
locations, and internal links under /projects/foundry.