name: Generate Docs

on:
  workflow_dispatch:

jobs:
  docs:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
    - name: Python
      uses: actions/setup-python@v2
      with:
        python-version: 3.8
    - name: Build
      run: |
        sudo apt-get install graphviz pandoc
        python -m pip install --upgrade pip
        pip install -e .[dev]
        make docs
    - name: Deploy
      uses: peaceiris/actions-gh-pages@v3
      with:
        github_token: ${{secrets.GITHUB_TOKEN}}
        publish_dir: docs/_build/html
