88 lines (74 loc) · 2.14 KB
/
rtd.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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
name: Read the Docs
on:
push:
branches:
- master
- develop
- 'release*'
- 'ci-pytest'
pull_request:
branches: [master, develop]
jobs:
rtd_build:
name: Read the Docs build
runs-on: ubuntu-latest
strategy:
fail-fast: false
defaults:
run:
shell: bash -l {0}
steps:
- name: Checkout flopy repo
uses: actions/checkout@v2.3.4
- name: Output repo information
run: |
echo $GITHUB_REPOSITORY_OWNER
echo $GITHUB_REPOSITORY
echo $GITHUB_REF
echo $GITHUB_EVENT_NAME
- name: Setup Python
uses: actions/setup-python@v2.2.2
with:
python-version: 3.8
- name: Upgrade pip
run: |
python -m pip install --upgrade pip
- name: Install prerequisites
run: |
pip install jupyter jupytext
- name: Install flopy and dependencies
run: |
pip install .[doc]
- name: Install executables and add to PATH
run: |
mkdir -p $HOME/.local/bin
get-modflow $HOME/.local/bin
echo "$HOME/.local/bin" >> $GITHUB_PATH
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Run jupytext on tutorials
working-directory: ./.docs
run: |
python create_tutorials.py
- name: Upload completed jupyter notebooks as an artifact for ReadtheDocs
if:
github.repository_owner == 'modflowpy' && github.event_name == 'push'
uses: actions/upload-artifact@v2
with:
name: notebooks-for-${{ github.sha }}
path: |
.docs/_notebooks
# trigger rtd if previous job was successful
rtd:
name: Read the Docs trigger
needs: rtd_build
runs-on: ubuntu-latest
if:
github.repository_owner == 'modflowpy' && github.event_name == 'push'
steps:
- name: Trigger RTDs build on master and develop branches
uses: dfm/rtds-action@v1.0.2
with:
webhook_url: ${{ secrets.RTDS_WEBHOOK_URL }}
webhook_token: ${{ secrets.RTDS_WEBHOOK_TOKEN }}
commit_ref: ${{ github.ref }}