name: Build documentation ⚙️

on:
  push:
    branches:
      - master
    paths:
      - 'docs/**'
  pull_request:
    branches:
      - master
    paths:
      - 'docs/**'
  release:
    types:
      - released

jobs:
  main:
    runs-on: ubuntu-22.04
    strategy:
      matrix:
        include:
          - python-version: '3.10'
    steps:
    - uses: actions/checkout@v2
    - uses: actions/setup-python@v2
      name: Setup Python ${{ matrix.python-version }}
      with:
        python-version: ${{ matrix.python-version }}
    - name: Install requirements 📦
      run: |
        pip3 install -r requirements.txt
        pip3 install -r docs/requirements.txt
    - name: build docs 🏗️
      run: cd docs && make html
