-
Notifications
You must be signed in to change notification settings - Fork 82
52 lines (45 loc) · 1.52 KB
/
master-push.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
# This workflow automatically generates the Sphinx documentation required for
# GitHub pages. Executed when master is pushed to.
name: Documentation update
on:
push:
branches: master
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-python@v2
with:
python-version: '3.8'
# Checkout the master branch (docs will be built from this)
- uses: actions/checkout@v2
with:
path: master
# Checkout the documentation branch (docs will be pushed to this)
- uses: actions/checkout@v2
with:
ref: gh_pages
path: gh_pages
- name: Install Sphinx requirements
working-directory: ${{ github.workspace }}/master/docs
run: |
sudo apt-get update -y
sudo apt-get install -y pandoc
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
- name: Build documentation
working-directory: ${{ github.workspace }}/master/docs
run: make html
- name: Move documentation
run: |
touch master/docs/build/html/.nojekyll
cp -a master/docs/build/html/. gh_pages/
- name: Upload documentation
working-directory: ${{ github.workspace }}/gh_pages
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add --all
git diff-index --quiet HEAD || git commit -m "docs update" -a
git push