Skip to content

Merge pull request #38 from ImperialCollegeLondon/9-complete-docs #33

Merge pull request #38 from ImperialCollegeLondon/9-complete-docs

Merge pull request #38 from ImperialCollegeLondon/9-complete-docs #33

Workflow file for this run

name: "Sphinx: Render docs"
on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: Gather dependencies
run: |
pip install -U pip
pip install -r requirements-dev.txt
- name: Run sphinx-apidoc
run: |
sphinx-apidoc -f -o docs/source/ pyprobe
- name: Clean old HTML files
run: |
rm -rf docs/build/html/*
- name: Build HTML
run: |
sphinx-build -b html docs/source docs/build/html
deploy:
needs: build
runs-on: ubuntu-latest
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
permissions:
contents: write
steps:
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: html-docs
path: docs/build/html/
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
if: github.ref == 'refs/heads/main'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: docs/build/html