-
Notifications
You must be signed in to change notification settings - Fork 421
45 lines (43 loc) · 1.23 KB
/
python_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
45
name: Docs
on:
push:
branches:
- develop
paths:
- 'docs/**'
- 'CHANGELOG.md'
- 'mkdocs.yml'
jobs:
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Python
uses: actions/[email protected]
with:
python-version: "3.8"
- name: Install dependencies
run: make dev
- name: Setup doc deploy
run: |
git config --global user.name Docs deploy
git config --global user.email [email protected]
- name: Build docs website and API reference
run: make release-docs VERSION="develop" ALIAS="stage"
- name: Deploy all docs
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./api
keep_files: true
destination_dir: develop/api
- name: Create redirect from old docs
run: |
git checkout gh-pages
test -f 404.html && echo "Redirect already set" && exit 0
git checkout develop -- 404.html
git add 404.html
git commit -m "chore: set docs redirect" --no-verify
git push origin gh-pages -f