-
Notifications
You must be signed in to change notification settings - Fork 17
93 lines (83 loc) · 2.39 KB
/
build_docs.yaml
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
89
90
91
92
93
# from pyproj: https://github.com/pyproj4/pyproj/blob/master/.github/workflows/build_docs.yaml
name: Publish Docs
on:
push:
branches: [ develop ]
release:
types: [ created ]
workflow_dispatch:
jobs:
docs:
name: Publish Docs
runs-on: ubuntu-latest
steps:
- name: Checkout source
uses: actions/checkout@v3
with:
persist-credentials: false
- name: Fetch all Git tags
run: git fetch --prune --unshallow --tags
- name: Setup Micromamba
uses: mamba-org/setup-micromamba@v1
with:
environment-file: ci/test_environment.yaml
cache-environment: false
cache-downloads: false
- name: Conda info
shell: bash -l {0}
run: micromamba info
- name: Add executables to path
shell: bash
run: |
if [[ ! -d "$HOME/.local/bin" ]]; then
mkdir -p "$HOME/.local/bin";
fi
# copy modflow bins to local dir to add to PATH later
if [ "$RUNNER_OS" == "Windows" ]; then
d="win"
elif [ "$RUNNER_OS" == "macOS" ]; then
d="mac"
elif [ "$RUNNER_OS" == "Linux" ]; then
d="linux"
else
d="unexpectedos"
exit 1
fi
cp -r bin/$d/. "$HOME/.local/bin/"
echo "$HOME/.local/bin" >> $GITHUB_PATH
echo $GITHUB_PATH
- name: Install Modflow-setup and ipykernel
shell: bash -l {0}
run: |
pip install -e .
python -m ipykernel install --user --name mfsetup_ci --display-name "mfsetup_ci"
- name: Conda list
shell: bash -l {0}
run: micromamba list
- name: Run tests
shell: bash -l {0}
run: |
pytest -v --durations=20
- name: Build docs
shell: bash -l {0}
run: |
set -e
make -C docs html
- name: Deploy 🚀
uses: JamesIves/[email protected]
if: ${{ github.event_name == 'release' }}
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: gh-pages
FOLDER: docs/build/html
CLEAN: false
TARGET_FOLDER: ${{ github.ref }}
- name: Deploy 🚀
uses: JamesIves/[email protected]
if: ${{ github.event_name == 'push' }}
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: gh-pages
FOLDER: docs/build/html
CLEAN: false
TARGET_FOLDER: latest