-
Notifications
You must be signed in to change notification settings - Fork 14
44 lines (40 loc) · 1.28 KB
/
deploy-gh-pages.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
name: Deploy gh-pages
on:
push:
branches: [ main ]
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: '3.8'
- name: Install dependencies
run: |
python -m pip install --upgrade pip Sphinx furo
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
python3 -m pip install ./python/_restclient[develop]
python3 -m pip install ./python/nwis_client[develop]
python3 -m pip install ./python/caches[develop]
python3 -m pip install ./python/nwm_client[develop]
python3 -m pip install ./python/events[develop]
python3 -m pip install ./python/metrics[develop]
- name: Build Sphinx documentation
run: |
cd docs/
make html
git checkout --track origin/gh-pages
rsync -ac _build/html/ ../
cd ..
rm -rf docs
if [[ $(git status --porcelain | wc -l) -gt 0 ]]; then
git config user.name "github-actions"
git config user.email "[email protected]"
git add -A
git commit -m "Deploy gh-pages"
git push origin gh-pages
fi