diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 8b137891..3c10be02 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -1 +1,68 @@ +on: + push: + branches: + - main + pull_request: + branches: + - main + + workflow_dispatch: + +permissions: + contents: read + +concurrency: + group: github-pages + cancel-in-progress: true + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v6 + + - name: Configure GitHub Pages + uses: actions/configure-pages@v5 + + - name: Install uv + uses: astral-sh/setup-uv@v8.3.2 + with: + enable-cache: true + python-version: "3.14t" + + - name: Install dependencies + run: uv sync --frozen --group docs + + - name: Build documentation + run: uv run sphinx-build -W docs/source docs/_build/html + + - name: Upload Pages artifact + uses: actions/upload-pages-artifact@v4 + with: + path: docs/_build/html + + deploy: + needs: build + runs-on: ubuntu-latest + + # Deploy pushes, manual runs, and PRs created from branches in this repository. + # Do not deploy untrusted pull requests from forks. + if: > + github.event_name != 'pull_request' || + github.event.pull_request.head.repo.full_name == github.repository + + permissions: + pages: write + id-token: write + + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 diff --git a/docs/source/conf.py b/docs/source/conf.py index 09546cba..14308680 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -50,4 +50,4 @@ # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". -html_static_path = ['_static'] \ No newline at end of file +html_static_path = []