-
-
Notifications
You must be signed in to change notification settings - Fork 0
45 lines (36 loc) · 1.26 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
name: Build Docs
on: push
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup Python environment
uses: actions/setup-python@v2
with:
python-version: '3.8'
- name: Build Documentation
run: |
python -m pip install --upgrade pip
pip install -r docs/requirements.txt
sphinx-build -b html docs build
- name: Upload documentation artifacts
uses: actions/upload-artifact@v2
with:
name: Documentation
path: |
build
retention-days: 3
- name: Create a new commit to gh-pages
if: success() && github.ref == 'refs/heads/main'
run: |
# Tell GitHub pages not to use Jekyll.
#
# Without creating the `.nojekyll` file, GitHub Pages will treat some
# paths differently. For example, directories starting with an
# underscore will not be served.
touch build/.nojekyll
git add --force build
git -c user.name="GitHub Actions" -c user.email="actions@github.com" commit -m "Apply automatic changes" --author="${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>"
git subtree split --prefix build -b gh-pages
git push --force origin gh-pages