[pre-commit.ci] pre-commit autoupdate (#104) #230
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and Deploy Docs | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
jobs: | |
build: | |
name: Build docs (python-${{ matrix.python-version }}, ${{ matrix.os }}) | |
strategy: | |
matrix: | |
os: | |
- ubuntu-latest | |
- windows-latest | |
- macos-latest | |
python-version: | |
- "3.12" | |
fail-fast: false | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up uv (Unix) | |
if: ${{ matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest' }} | |
run: curl -LsSf https://astral.sh/uv/install.sh | sh | |
- name: Set up uv (Windows) | |
if: ${{ matrix.os == 'windows-latest' }} | |
run: irm https://astral.sh/uv/install.ps1 | iex | |
shell: powershell | |
- name: Restore uv cache | |
uses: actions/cache@v4 | |
with: | |
path: | | |
~/.cache/uv | |
~/AppData/Local/uv | |
~/.uv | |
key: ${{ runner.os }}-uv-${{ hashFiles('**/pyproject.toml') }} | |
restore-keys: | | |
${{ runner.os }}-uv- | |
- name: Set up Python ${{ matrix.python-version }} | |
run: uv python install ${{ matrix.python-version }} | |
- name: Install the project | |
run: uv sync --all-extras --dev | |
- name: Build docs | |
run: uv run mkdocs build | |
- name: Minimize uv cache | |
run: uv cache prune --ci | |
deploy: | |
name: Deploy docs | |
needs: build | |
if: github.event_name == 'push' && github.ref == 'refs/heads/master' | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up uv | |
run: curl -LsSf https://astral.sh/uv/install.sh | sh | |
- name: Restore uv cache | |
uses: actions/cache@v4 | |
with: | |
path: ~/.cache/uv | |
key: ${{ runner.os }}-uv-${{ hashFiles('**/pyproject.toml') }} | |
restore-keys: | | |
${{ runner.os }}-uv- | |
- name: Set up Python | |
run: uv python install 3.12 | |
- name: Install the project | |
run: uv sync --all-extras --dev | |
- name: Deploy docs | |
run: uv run mkdocs gh-deploy --force | |
- name: Minimize uv cache | |
run: uv cache prune --ci |