Docs-as-Code Workflow¶
- Write or edit Markdown.
- Preview locally.
make servestarts the Zensical dev server. - Build.
make buildcompiles the site tosite/. - Deploy. Trigger the GitHub Actions workflow or run
./doc-cli.sh deploy <version> --push.
For versioning details, see Versioning.
Quick commands¶
| Task | Command |
|---|---|
| Local preview | make serve |
| Build site | make build |
| Deploy version | ./doc-cli.sh deploy 0.4.0 --push |
| List versions | uv run python scripts/python/versioned_deploy.py list |
CI behavior¶
- Push to main: Builds and validates the site. No deployment.
- Pull request: Builds and runs structure tests.
- Workflow dispatch: Deploys the specified version to GitHub Pages.
To deploy, go to Actions > Build and Deploy Docs > Run workflow and enter the version number.
Why we use a custom versioning script¶
Zensical does not yet support versioning natively. The team has it on their roadmap with plans for both directory-based and git-based versioning.
Until then, we use versioned_deploy.py to provide mike-style versioned deployments. This script:
- Builds with Zensical
- Copies output to versioned directories on
gh-pages - Maintains
versions.jsonfor the version selector - Handles the
latestalias
When Zensical ships native versioning, we can migrate to their approach.