Skip to content

Documentation

Documentation #149

Workflow file for this run

name: Documentation
on:
push:
branches: [ master, develop, release/** ]
pull_request:
types: [ opened, synchronize, reopened ]
workflow_dispatch:
inputs:
triggeredBy:
description: 'Name of team member who is manually triggering this workflow'
required: true
permissions:
contents: write
jobs:
build-docs:
runs-on: ubuntu-latest
steps:
- run: |
echo "This workflow was triggered by: $TRIGGER_PERSON"
env:
TRIGGER_PERSON: ${{ inputs.triggeredBy }}
- run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event."
- run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!"
- run: echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}."
#----------------------------------------------
# check-out repo and set-up python
#----------------------------------------------
- name: Check out repository
uses: actions/checkout@v4
- name: Set up python
id: setup-python
uses: actions/setup-python@v5
with:
python-version: '3.11.8'
#----------------------------------------------
# ----- install & configure poetry -----
#----------------------------------------------
- name: Install Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true
#----------------------------------------------
# load cached venv if cache exists
#----------------------------------------------
- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v4
with:
path: .venv
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
#----------------------------------------------
# install dependencies if cache does not exist
#----------------------------------------------
- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry install --no-interaction --no-root
#----------------------------------------------
# install your root project, if required
#----------------------------------------------
- name: Install project
run: poetry install --all-extras --no-interaction --with docs
#----------------------------------------------
# publish documentation
#----------------------------------------------
- name: Sphinx build
run: |
poetry run sphinx-build docs/source _build
- name: Deploy
if: github.head_ref == 'master'
uses: peaceiris/actions-gh-pages@v3
with:
publish_branch: gh-pages
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: _build/
force_orphan: true