-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (53 loc) · 1.74 KB
/
Copy pathdocs.yml
File metadata and controls
64 lines (53 loc) · 1.74 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
name: Deploy Docs
on:
push:
branches:
- main
tags:
- "v*"
workflow_dispatch:
permissions:
contents: write
concurrency:
group: pages
cancel-in-progress: false
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install uv
uses: astral-sh/setup-uv@v5
- name: Set up Python
run: uv python install 3.13
- name: Install dependencies
run: uv sync --group docs
- name: Configure git
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
- name: Fetch gh-pages branch
run: git fetch origin gh-pages --depth=1 || true
- name: Deploy dev docs (main branch)
if: github.ref == 'refs/heads/main'
run: |
uv run mike deploy --push dev
# TODO: When docs are stable, uncomment the block below and remove the line after it
# to change default back to "latest"
# # Set default to latest tag if exists, otherwise dev
# if git describe --tags --abbrev=0 --match 'v*' >/dev/null 2>&1; then
# uv run mike set-default --push latest
# else
# uv run mike set-default --push dev
# fi
uv run mike set-default --push dev
- name: Deploy versioned docs (tag)
if: startsWith(github.ref, 'refs/tags/v')
run: |
VERSION=${GITHUB_REF#refs/tags/v}
uv run mike deploy --push --update-aliases $VERSION latest
# TODO: When docs are stable, change back to "latest"
# uv run mike set-default --push latest
uv run mike set-default --push dev