-
Notifications
You must be signed in to change notification settings - Fork 0
58 lines (55 loc) · 1.63 KB
/
deploy_doc.yml
File metadata and controls
58 lines (55 loc) · 1.63 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
name: Deploy Documentation
on:
workflow_dispatch:
inputs:
branch:
description: 'Branch to deploy docs from'
required: true
default: 'main'
type: choice
options:
- main
- 2.x
version_alias:
description: 'Version alias for docs (e.g., 3.x, 2.x)'
required: true
default: '3.x'
type: choice
options:
- 3.x
- 2.x
set_latest:
description: 'Set this version as latest?'
required: true
default: true
type: boolean
jobs:
deploy-docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.branch }}
fetch-depth: 0
- uses: actions/setup-python@v6
with:
python-version-file: ".python-version"
- name: Install uv
uses: astral-sh/setup-uv@v7
- name: Install dependencies
run: uv sync --group docs --frozen
- name: Configure Git for mike
run: |
git config user.name github-actions
git config user.email github-actions@github.com
- name: Deploy docs with mike
run: |
# Fetch gh-pages branch if it exists
git fetch origin gh-pages:gh-pages || true
# Deploy the version
if [ "${{ github.event.inputs.set_latest }}" = "true" ]; then
uv run mike deploy --push --update-aliases ${{ github.event.inputs.version_alias }} latest
uv run mike set-default --push latest
else
uv run mike deploy --push ${{ github.event.inputs.version_alias }}
fi