documentation deployment
.github/workflows/documentation.yml, workflow name Sphinx: build && deploy docs.
flowchart TD
Push["push any branch / PR / dispatch"] --> Job["ubuntu-latest Python 3.12"]
Job --> Po["poetry install --with docs"]
Po --> Sphinx["sphinx-build -b html docs docs/_build/html"]
Sphinx --> CNAME["echo pyjiit.codelif.in"]
CNAME --> Gate{"push to main?"}
Gate -->|yes| GH["peaceiris gh-pages"]
Gate -->|no| Skip["build only"]Triggers#
- push to any branch (
**) - pull_request
- workflow_dispatch
Concurrency group docs-${{ github.ref }}, cancel-in-progress: true.
Steps#
actions/checkout@v4actions/setup-python@v5Python 3.12, pip cacheactions/cache@v3on~/.cache/pypoetryand~/.cache/pip, key hashed frompoetry.lockandpyproject.tomlpip install poetrypoetry install --no-interaction --no-ansi --with docspoetry run sphinx-build -b html docs docs/_build/htmlecho "pyjiit.codelif.in" > docs/_build/html/CNAMEpeaceiris/actions-gh-pages@v3only ifgithub.event_name == 'push' && github.ref == 'refs/heads/main'
Deploy uses GITHUB_TOKEN, publish_branch: gh-pages, publish_dir: docs/_build/html, force_orphan: true.
Permissions: contents: write.
Live URL#
README.rst: https://pyjiit.codelif.in. That matches the CNAME the workflow writes. The fork at tashifkhan/pyjiit keeps the same workflow file, so a Pages deploy from the fork would still stamp that hostname unless you change it.
flowchart LR Main["main push"] --> Pages["gh-pages orphan commit"] Pages --> DNS["pyjiit.codelif.in"]