name: Github Pages

on:
  push:
    branches:
      - master

jobs:
  deploy:
    runs-on: ubuntu-20.04
    steps:
      - uses: actions/checkout@v2

      - name: Setup Python
        uses: actions/setup-python@v1
        with:
          python-version: '3.x'

      - name: Install Dependencies
        run: |
          python -m pip install -U pip
          python -m pip install -U sphinx
          python -m pip install -U sphinxcontrib.prettyspecialmethods

      - name: Build Docs
        run: make -C docs clean html
        ## https://github.com/marketplace/actions/sphinx-build
        # uses: ammaraskar/sphinx-action@0.3
        # with:
        #   docs-folder: docs/
        #   repo-token: ${{ secrets.GITHUB_TOKEN }}
        #   build-command: "make clean html"

      - name: Deploy Docs
        uses: peaceiris/actions-gh-pages@v3
        with:
          deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
          publish_dir: docs/html
