Skip to content

ci: improve doc deploy (#273) #460

ci: improve doc deploy (#273)

ci: improve doc deploy (#273) #460

Workflow file for this run

name: Docs
on:
push:
branches:
- master
pull_request:
jobs:
docs:
name: Docs (python-${{ matrix.python-version }}, ${{ matrix.os }})
strategy:
matrix:
python-version:
- "3.13"
os:
- ubuntu-latest
# - macos-latest
# - windows-latest
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- name: Setup pandoc
uses: pandoc/actions/setup@v1
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
cache-dependency-glob: "uv.lock"
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install the project
run: uv sync --extra docs
- name: Build docs
run: uv run mkdocs build
# Only deploy on ubuntu-latest with Python 3.13 when pushing to master
- name: Deploy docs
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.13' && github.event_name == 'push' && github.ref == 'refs/heads/master'
run: uv run mkdocs gh-deploy --force
- name: Minimize uv cache
run: uv cache prune --ci