-
Notifications
You must be signed in to change notification settings - Fork 16
57 lines (50 loc) · 1.42 KB
/
build_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
46
47
48
49
50
51
52
53
54
55
56
57
# Build and push the docs website
name: Build docs
on:
pull_request:
push:
schedule:
- cron: '0 */8 * * *'
jobs:
build:
runs-on: ubuntu-latest
strategy:
max-parallel: 4
matrix:
python-version: [3.9]
steps:
- name: Use checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install requirements
run: |
python3 -m pip install -r docs/requirements.txt
- name: Render the docs
run: |
cd ./docs
make html
- uses: actions/upload-artifact@v4
with:
name: DocumentationHTML
path: docs/_build/html/
if-no-files-found: error
- name: Commit documentation changes
run: |
tmp_folder=$(mktemp -d /tmp/tmp.XXXXXXXXXX)
cp -r docs/_build/html/* $tmp_folder/
rm -rf *; rm -rf .github
git switch --orphan gh-pages
cp -r $tmp_folder/* .
touch .nojekyll
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add .
git commit -m "Update documentation" -a || true
- name: Push changes
if: github.event_name == 'push'
uses: ad-m/github-push-action@master
with:
force: true
branch: gh-pages
github_token: ${{ secrets.GITHUB_TOKEN }}