Merge pull request #279 from corenting/dependabot/pip/development-dep… #22
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "Documentation" | |
on: | |
push: | |
branches: | |
- "master" | |
tags: | |
- "v*" | |
pull_request: | |
branches: | |
- "master" | |
jobs: | |
build: | |
name: Build sphinx documentation | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Install Poetry | |
run: pipx install poetry | |
- name: Setup Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.12 | |
cache: "poetry" | |
- name: Setup environment | |
run: poetry install | |
- name: Build HTML | |
run: poetry run sphinx-build -M html docs docs/build | |
- name: Upload artifacts | |
uses: actions/upload-pages-artifact@v2 | |
with: | |
path: docs/build/html/ | |
deploy: | |
name: Deploy documentation | |
runs-on: ubuntu-latest | |
needs: build | |
if: startsWith(github.ref, 'refs/tags/v') | |
permissions: | |
pages: write # to deploy to Pages | |
id-token: write # to verify the deployment originates from an appropriate source | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
steps: | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v2 # or the latest "vX.X.X" version tag for this action | |