-
Notifications
You must be signed in to change notification settings - Fork 14
48 lines (45 loc) · 1.16 KB
/
docs.yml
File metadata and controls
48 lines (45 loc) · 1.16 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
name: Docs
on:
push:
branches:
- develop
- v2
paths:
- 'docs/**'
- 'mkdocs.yml'
- 'requirements-docs.txt'
- '.github/workflows/docs.yml'
workflow_dispatch:
permissions:
contents: write
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- uses: actions/setup-python@v6
with:
python-version: 3.x
- run: pip install -r requirements-docs.txt
- run: git fetch origin gh-pages --depth=1
- run: git config user.name github-actions[bot]
- run: git config user.email 41898282+github-actions[bot]@users.noreply.github.com
- name: Deploy docs with mike
env:
BRANCH_NAME: ${{ github.ref_name }}
run: |
case "$BRANCH_NAME" in
develop)
mike deploy --push --update-aliases dev latest
mike set-default --push latest
;;
v2)
mike deploy --push --update-aliases v2
;;
*)
echo "Unsupported docs branch: $BRANCH_NAME"
exit 1
;;
esac