name: documentation

on: [workflow_dispatch]

permissions:
  contents: write

jobs:
  docs:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: actions/setup-python@v3
        with: 
          python-version: "3.8"
      - name: Install dependencies
        run: |
          pip install sphinx sphinx_rtd_theme myst_parser sphinx_new_tab_link
          sudo chmod +x install.sh
          ./install.sh
      - name: Sphinx build
        run: |
          sphinx-build docs/source _build
      - name: Publish
        uses: JamesIves/github-pages-deploy-action@v4.3.0
        with:
          branch: gh-pages # The branch the action should deploy to.
          folder: _build # Deploy the built docs folder
