-
-
Notifications
You must be signed in to change notification settings - Fork 533
74 lines (62 loc) · 1.82 KB
/
docs.yml
File metadata and controls
74 lines (62 loc) · 1.82 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
name: Documentation Building
on:
release:
types: [published]
push:
branches:
- main
- v2
workflow_dispatch:
inputs:
version:
description: 'Version to build docs for (1, 2, main, or release)'
required: true
default: 'main'
type: choice
options:
- main
- '2'
- '1'
- release
env:
UV_LOCKED: 1
jobs:
docs:
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: "3.12"
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
version: "0.5.4"
enable-cache: true
- name: Install dependencies
run: uv sync
- name: Fetch gh pages
run: git fetch origin gh-pages --depth=1
- name: Build release docs
run: uv run python tools/build_docs.py docs-build
if: github.event_name == 'release'
- name: Build docs (main branch)
run: uv run python tools/build_docs.py docs-build --version main
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
- name: Build docs (v2 branch)
run: uv run python tools/build_docs.py docs-build --version 2
if: github.event_name == 'push' && github.ref == 'refs/heads/v2'
- name: Build docs (manual trigger)
run: |
if [ "${{ inputs.version }}" == "release" ]; then
uv run python tools/build_docs.py docs-build
else
uv run python tools/build_docs.py docs-build --version ${{ inputs.version }}
fi
if: github.event_name == 'workflow_dispatch'
- name: Deploy
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: docs-build