Skip to content

Updates: linting, build environment, documentation formatting #1

Updates: linting, build environment, documentation formatting

Updates: linting, build environment, documentation formatting #1

---
name: "🗒️ Build documentation"
# yamllint disable-line rule:truthy
on:
workflow_dispatch:
pull_request:
types: [closed]
jobs:
build_and_deploy:
# Don't run if pull request is NOT merged
if: github.event.pull_request.merged == true
name: "Rebuild documentation"
runs-on: ubuntu-latest
continue-on-error: true
strategy:
matrix:
python-version: ["3.11"]
steps:
- name: "Checkout repository"
uses: actions/checkout@v4
- name: "Setup PDM for build commands"
uses: pdm-project/setup-pdm@v3
- name: "Set up Python ${{ matrix.python-version }}"
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: "Install dependencies"
run: |
python -m pip install --upgrade pip
pdm export -o requirements.txt
if [ -f docs/requirements.txt ]; then
pip install -r docs/requirements.txt; fi
- name: "Build documentation: (tox/sphinx)"
run: |
tox -e docs
- name: "Publish documentation"
if: success()
uses: peaceiris/actions-gh-pages@v3
with:
publish_branch: gh-pages
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: docs/_build/html/
keep_files: true