-
Notifications
You must be signed in to change notification settings - Fork 20
56 lines (45 loc) · 1.3 KB
/
update-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
name: Build and publish docs
on:
push:
branches: [main]
pull_request:
branches: [main]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build-docs:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
id: cache
with:
path: docs/_build
key: docs-${{ hashFiles('./docs') }}
- uses: ./.github/setup_datman
if: steps.cache.outputs.cache-hit != 'true'
- name: Install docs requirements
if: steps.cache.outputs.cache-hit != 'true'
run: python -m pip install .[docs]
- name: Build docs
if: steps.cache.outputs.cache-hit != 'true'
run: sphinx-build docs docs/_build
publish-docs:
needs: build-docs
if: github.event_name == 'push'
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
id: cache
with:
path: docs/_build
key: docs-${{ hashFiles('./docs') }}
- name: Add .nojekyll file to build folder
run: touch docs/_build/.nojekyll
- name: Deploy docs if the branch has updated
uses: JamesIves/[email protected]
with:
branch: gh-pages
folder: docs/_build