-
Notifications
You must be signed in to change notification settings - Fork 23
44 lines (41 loc) · 1.28 KB
/
deploy_docs.yml
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
name: Deploy documentation
on:
push:
branches:
- main
tags:
- 'v*'
concurrency: docs
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
# Download all git history to enable git revision history display in docs pages
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install dependencies
run: |
python -m pip install --upgrade pip wheel setuptools
python -m pip install -r docs/requirements.txt
- name: Build docs
run: mkdocs build
- name: Set Git CI config
run: |
git config user.name gh-ci-deploy-docs
git config user.email [email protected]
- name: Calculate docs version
run: |
python3 scripts/get_docs_version.py > version.json
cat version.json
echo "VERSION=$(cat version.json)" >> $GITHUB_ENV
- name: Deploy latest docs
if: fromJson(env.VERSION).type == 'latest'
run: mike deploy --push latest
- name: Deploy stable docs
if: fromJson(env.VERSION).type == 'stable'
run: mike deploy --push -u --no-redirect ${{ fromJson(env.VERSION).version }} stable