Repository navigation
56 lines (46 loc) · 1.73 KB
/
Copy pathdocs.yml
File metadata and controls
56 lines (46 loc) · 1.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# Build and publish the documentation with mike (versioned MkDocs).
# * push to main -> refresh the rolling `dev` docs
# * push a v* tag -> publish the release docs as `X.Y` and move the `latest` alias
name: docs
on:
push:
branches: [main]
tags: ["v*"]
workflow_dispatch:
# mike commits the built site to the gh-pages branch.
permissions:
contents: write
# Prevent concurrent deploys from clobbering gh-pages.
concurrency:
group: docs-deploy
cancel-in-progress: false
jobs:
deploy-docs:
runs-on: ubuntu-latest
steps:
- name: Check out the repository
uses: actions/checkout@v6
with:
fetch-depth: 0 # full history for mike and setuptools_scm
- name: Configure git identity
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
- name: Fetch existing docs branch
run: git fetch origin gh-pages --depth=1 || true
- name: Set up uv
uses: astral-sh/setup-uv@v8.1.0
# Core package + docs toolchain only (no extras); enough to build the API docs.
- name: Install docs dependencies
run: uv sync --group docs
# Tag build: publish X.Y (docs are versioned by minor) and update `latest`.
- name: Deploy release docs
if: startsWith(github.ref, 'refs/tags/v')
run: |
DOCS_VERSION="$(echo "${GITHUB_REF_NAME#v}" | cut -d. -f1,2)"
uv run mike deploy --push --update-aliases "$DOCS_VERSION" latest
uv run mike set-default --push latest
# Main build: refresh the rolling `dev` docs.
- name: Deploy dev docs
if: github.ref == 'refs/heads/main'
run: uv run mike deploy --push dev