github actions workflows
Two YAML files under .github/workflows/.
| File | Name | Trigger | Effect |
|---|---|---|---|
documentation.yml |
Sphinx: build && deploy docs | push **, pull_request, workflow_dispatch |
Sphinx HTML; Pages on main |
python-publish.yml |
Build and publish python package | release published, workflow_dispatch | poetry publish --build |
flowchart TB
subgraph documentation [documentation.yml]
T1["push / PR / dispatch"] --> B1["poetry install --with docs"]
B1 --> S["sphinx-build"]
S --> C["CNAME pyjiit.codelif.in"]
C --> If{"push and ref main"}
If -->|yes| GP["peaceiris gh-pages"]
end
subgraph publish [python-publish.yml]
T2["release / dispatch"] --> B2["poetry install"]
B2 --> P["poetry publish --build"]
enddocumentation.yml#
Concurrency: docs-${{ github.ref }}, cancel in progress.
Python 3.12, pip cache, extra cache on Poetry and pip directories keyed by poetry.lock + pyproject.toml.
Install:
poetry config virtualenvs.create true
poetry config virtualenvs.in-project false
poetry install --no-interaction --no-ansi --with docs
Build:
poetry run sphinx-build -b html docs docs/_build/html
echo "pyjiit.codelif.in" > docs/_build/html/CNAME
Deploy step if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} with force_orphan: true on gh-pages.
PRs and non-main branches only prove that Sphinx still builds.
sequenceDiagram
participant GH as GitHub
participant R as runner
participant Pages as gh-pages
GH->>R: push
R->>R: poetry install --with docs
R->>R: sphinx-build
alt main
R->>Pages: orphan commit HTML plus CNAME
else other ref
R-->>GH: artifact-less green build
endpython-publish.yml#
No docs extra. poetry install then token then poetry publish --build. Secret name is PYPI_API_KEY.
flowchart LR Rel["release published"] --> Inst["poetry install"] Inst --> Key["secrets.PYPI_API_KEY"] Key --> Up["PyPI pyjiit"]
Gaps#
- No workflow runs
test_signin.py(good: it needs live credentials). - No matrix for Python 3.9 through 3.12 even though the package claims 3.9+.
- Docs CNAME is hardcoded to the upstream domain.
Fork: tashifkhan/pyjiit. Upstream URLs in pyproject.toml and Sphinx footer stay codelif/pyjiit.