name: Publish

on:
  push:
    branches:
      - master

jobs:
  build:

    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v1
    - name: Install dependencies
      run: |
        export PATH="$HOME/.local/bin:$PATH"
        sudo apt-get install -y python3-setuptools
        pip3 install --user -r sphinx-requirements.txt
    - name: Build the docs
      run: |
        export PATH="$HOME/.local/bin:$PATH"
        make html
    - name: Push the docs
      uses: peaceiris/actions-gh-pages@v3
      with:
        github_token: ${{ secrets.GITHUB_TOKEN }}
        publish_dir: _build/html
        publish_branch: latestHTML