diff --git a/.github/workflows/sphinx.yml b/.github/workflows/sphinx.yml index 6e53a67..6775adb 100644 --- a/.github/workflows/sphinx.yml +++ b/.github/workflows/sphinx.yml @@ -1,18 +1,24 @@ -name: Sphinx to GitHub Pages - -on: - push: - branches: [main] # branch to trigger deployment - +name: Docs +on: [push, pull_request, workflow_dispatch] +permissions: + contents: write jobs: - pages: - runs-on: ubuntu-20.04 - environment: - name: github-pages - url: ${{ steps.deployment.outputs.page_url }} - permissions: - pages: write - id-token: write + docs: + runs-on: ubuntu-latest steps: - - id: deployment - uses: sphinx-notes/pages@3.0 + - uses: actions/checkout@v3 + - uses: actions/setup-python@v3 + - name: Install dependencies + run: | + pip install sphinx sphinx_rtd_theme + - name: Sphinx build + run: | + sphinx-build docs/source _build + - name: Deploy + uses: peaceiris/actions-gh-pages@v3 + if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} + with: + publish_branch: gh-pages + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: _build/ + force_orphan: true