name: Documentation

on:
  push:
    paths:
      - 'docs/**'
      - '.github/workflows/docs.yml'
    branches:
      - master
  pull_request:
    paths:
      - 'docs/**'
      - '.github/workflows/docs.yml'
    branches:
      - '**'

jobs:
  docs:
    name: Documentation Build
    runs-on: Ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: actions/setup-python@v2
        with:
          python-version: 3.8
      - name: Install tox
        run: pip install tox
      - name: Build documentation
        run: tox -e doc
