Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 70 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: Docs

on:
push:
branches: ["main"]
pull_request:
workflow_dispatch:

permissions:
contents: read
pages: write
id-token: write

concurrency:
group: "pages"
cancel-in-progress: false

jobs:
build:
name: Build Python docs
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version-file: python/pyproject.toml

- name: Setup uv (with cache)
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
working-directory: python

- name: Sync dependencies (uv.lock)
working-directory: python
run: |
uv sync --locked --group docs

- name: Configure GitHub Pages
if: github.event_name != 'pull_request'
uses: actions/configure-pages@v5

- name: Build MkDocs site
working-directory: python
run: |
uv run --no-sync mkdocs build --strict --site-dir site

- name: Upload Pages artifact
if: github.event_name != 'pull_request'
uses: actions/upload-pages-artifact@v3
with:
path: python/site

deploy:
name: Deploy to GitHub Pages
if: github.event_name != 'pull_request'
needs: build
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

steps:
- name: Deploy
id: deployment
uses: actions/deploy-pages@v4
7 changes: 7 additions & 0 deletions python/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,13 @@ dev = [
"pytest-httpserver>=1.1.3",
]

docs = [
"mkdocs>=1.6",
"mkdocs-material>=9.5",
"mkdocstrings[python]>=0.25",
"pymdown-extensions>=10.0",
]

[tool.ruff]
line-length = 88
indent-width = 4
Expand Down
Loading