name: Build Documentation
on:
  push:
    branches: [ main ]
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v2
      - name: Install pipenv
        run: pipx install pipenv
      - uses: actions/setup-python@v3
        with:
          python-version: '3.7' # Version range or exact version of a Python version to use, using SemVer's version range syntax
          architecture: 'x64' # optional x64 or x86. Defaults to x64 if not specified
      - run: pipenv sync
        working-directory: ./docs
      - name: build the documentation
        run: pipenv run make html
        working-directory: ./docs
      - run: touch .nojekyll
        working-directory: ./docs/build/html
      - name: Deploy 🚀
        uses: JamesIves/github-pages-deploy-action@v4.3.0
        with:
          branch: gh-pages # The branch the action should deploy to.
          folder: docs/build/html # The folder the action should deploy.
      

