-
Notifications
You must be signed in to change notification settings - Fork 91
60 lines (58 loc) · 1.55 KB
/
generate-documentation.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
58
59
60
name: Generate Documentation
on:
release:
types: [published]
push:
branches:
- main
pull_request:
jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
shell: bash
strategy:
fail-fast: false
matrix:
python-version: [3.8]
steps:
- name: Checkout
uses: actions/checkout@v2
with:
persist-credentials: false
fetch-depth: 0
- name: Event type
run: echo $EVENT_TYPE
env:
EVENT_TYPE: ${{ github.event_name }}
- name: Install pandoc
uses: r-lib/actions/setup-pandoc@v1
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip wheel setuptools
python -m pip install -r requirements.txt
python -m pip install -r docs/requirements.txt
python -m pip list
- name: Install sphinx-material
run: python -m pip install -e . --no-build-isolation -v
- name: Build documentation
run: |
pushd docs
O="-j auto" make html
popd
- name: Move and commit documentation
env:
GIT_TAG: ${{ github.event.release.tag_name }}
run: |
source tools/docbuild-commit.sh
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: gh-pages
if: ${{ github.event_name == 'release' || github.event_name == 'push' }}