name: Build Docs

on:
  push:
    branches: [ master ]

  workflow_dispatch:

jobs:
  build:
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os: [ubuntu-20.04]
      fail-fast: false


    steps:
      - uses: actions/checkout@v2

      - name: build docs
        run: |
          scripts/install_docs_deps.sh
          ./make_docs.sh
          cd html-dir
          touch .nojekyll
          cd ../..

      - name: Deploy
        uses: peaceiris/actions-gh-pages@v3
        with:
          github_token: ${{ secrets.GITHUB_TOKEN }}
          publish_dir: html-dir
          publish_branch: gh_pages
