Skip to content

Merge pull request #356 from JdeRobot/issue-352 #26

Merge pull request #356 from JdeRobot/issue-352

Merge pull request #356 from JdeRobot/issue-352 #26

name: Build and Update Sphinx Docs
on:
push:
branches: [master]
workflow_dispatch:
permissions:
contents: write
jobs:
build-docs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
cache: "pip"
- name: Install Poetry
run: |
python -m pip install --upgrade pip
pip install poetry
- name: Install dependencies (main + docs)
run: |
poetry install --with docs --no-interaction
- name: Generate API docs (sphinx-apidoc)
run: |
poetry run sphinx-apidoc -o docs/py_docs/source/api perceptionmetrics -f
- name: Build Sphinx Docs
run: |
rm -rf docs/py_docs/build/html
poetry run sphinx-build -b html docs/py_docs/source docs/py_docs/build/html
- name: Commit updated docs
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git add docs/py_docs/build/html docs/py_docs/source/api
git diff --cached --quiet && echo "No changes to commit" && exit 0
git commit -m "Update Sphinx documentation"
git push