-
Notifications
You must be signed in to change notification settings - Fork 51
39 lines (38 loc) · 1.26 KB
/
publish-doc.yaml
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
name: publish-doc
on:
push:
branches:
- main
- 'release-v*.*.*'
jobs:
publish-docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: true
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Configure git
run: |
git config --global user.email "[email protected]"
git config --global user.name "ci-bot"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install mkdocs-material mike
- name: Deploy to Mike
run: |
if [[ ${{ github.ref }} == refs/heads/main ]]; then
# Deploy to the mike doc version `dev` and update the `latest` alias for the main branch new git commits
mike deploy dev latest --update-aliases --push
mike set-default latest
elif [[ ${{ github.ref }} == refs/heads/release-v* ]]; then
# Deploy to the mike doc version `vx.x.x` for the new git branches `release-vx.x.x`
branch_name=${{ github.ref }}
version=${branch_name##refs/heads/release-}
mike deploy $version --push
fi