GitHub Pages deployment
This repository ships documentation with Material for MkDocs-compatible configuration (mkdocs.yml) and deploys from GitHub Actions using Zensical to build the static site, then peaceiris/actions-gh-pages to push the result to the gh-pages branch.
We stay on MkDocs 1.x with an explicit mkdocs>=1.5,<2 pin (see pyproject.toml) because MkDocs 2.0 is not a drop-in replacement for Material or the existing plugin stack. CI builds the live site with Zensical; strict Markdown checks still run in the test workflow via uv run mkdocs build --strict (Zensical’s build --strict is not available yet).
One-time repository settings
- In GitHub: Settings → Pages (for
miguelenes/doctranslateor your fork). - Under Build and deployment → Source, choose Deploy from a branch (not “GitHub Actions” unless you switch the workflow to
actions/deploy-pages). - Set Branch to
gh-pagesand folder/ (root), then save. - After the first successful workflow run, the site should be available at
https://miguelenes.github.io/doctranslate/(orhttps://<owner>.github.io/<repo>/for other forks).
site_url in mkdocs.yml must match that public URL (including trailing slash) so internal links and canonical URLs resolve correctly.
How it runs
- Workflow: .github/workflows/docs.yml
- Trigger: push to
mainormaster, or Run workflow manually (workflow_dispatch). - Steps:
uv sync --locked --group dev --extra full→uv run zensical build --clean→ deploy./sitetogh-pages.
Local development
- Live preview (MkDocs):
uv run mkdocs serve— same plugins and strict behavior you are used to. - CI-like static build (Zensical):
uv run zensical build --clean— output insite/(ignored by git).
After changing dependencies in pyproject.toml, refresh the lockfile with uv lock so uv sync --locked keeps working in CI.
Troubleshooting
- Workflow succeeds but site 404: Pages source is still None or points at the wrong branch — set gh-pages / root as above.
- Push / deploy denied: Ensure Settings → Actions → General → Workflow permissions allows Read and write for the default
GITHUB_TOKEN(required forpeaceiris/actions-gh-pagesto updategh-pages). - Strict build fails in CI: Fix MkDocs warnings locally with
NO_MKDOCS_2_WARNING=1 uv run mkdocs build --strict, then push again. uv sync --lockedfails after pulling: Runuv lockon a machine with network access and commit the updateduv.lock.
Release and publishing
PyPI releases are driven by .github/workflows/publish-to-pypi.yml:
- PyPI: when
pyproject.tomlversion changes onmain/masterand the workflow detects a new tag, the built wheel/sdist is published to PyPI (Trusted Publishing). - TestPyPI: pushes that do not correspond to a new tagged version get a development version (
bumpver+ timestamp) and publish to TestPyPI instead.
The workflow only runs publishing steps for the repositories listed in the workflow’s check-repository job. Forks still benefit from tests and docs builds but do not publish packages from this workflow.
Version bumps in-tree use bumpver (see [tool.bumpver] in pyproject.toml).