Files
tzst/.github/workflows/publish-docs.yml
T
dependabot[bot] 2e34172f0c chore(deps): bump actions/setup-python from 6 to 7
Bumps [actions/setup-python](https://github.com/actions/setup-python) from 6 to 7.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](https://github.com/actions/setup-python/compare/v6...v7)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-version: '7'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-08-01 04:52:54 +00:00

111 lines
2.8 KiB
YAML

name: Publish Documentation
on:
push:
branches:
- main
paths-ignore:
- "*.md"
- "LICENSE"
- ".gitignore"
pull_request:
branches:
- main
paths-ignore:
- "*.md"
- "LICENSE"
- ".gitignore"
jobs:
build-and-deploy-docs:
runs-on: ubuntu-latest
permissions:
contents: write
pages: write
id-token: write
steps:
- name: Checkout code
uses: actions/checkout@v7
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v7
with:
python-version: "3.12"
- name: Cache pip dependencies
uses: actions/cache@v6
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-docs-${{ hashFiles('docs/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-docs-
${{ runner.os }}-pip-
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e .
pip install -r docs/requirements.txt
- name: Build Sphinx documentation
run: |
cd docs
python -m sphinx -b html . _build -W --keep-going
- name: Upload documentation artifacts
uses: actions/upload-artifact@v7
with:
name: documentation
path: docs/_build/
retention-days: 30
- name: Deploy to GitHub Pages
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: docs/_build
force_orphan: true
user_name: "github-actions[bot]"
user_email: "github-actions[bot]@users.noreply.github.com"
commit_message: "Deploy documentation from ${{ github.sha }}"
cname: tzst.xi-xu.me
docs-quality-check:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout code
uses: actions/checkout@v7
- name: Set up Python
uses: actions/setup-python@v7
with:
python-version: "3.12"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e .
pip install -r docs/requirements.txt
- name: Check documentation links
run: |
cd docs
sphinx-build -b linkcheck . _build/linkcheck -W --keep-going
continue-on-error: true
- name: Check documentation coverage
run: |
cd docs
sphinx-build -b coverage . _build/coverage
if [ -f _build/coverage/python.txt ]; then
echo "Documentation coverage report:"
cat _build/coverage/python.txt
fi
continue-on-error: true