Nwm client transition (#265) #126
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy gh-pages | |
on: | |
push: | |
branches: [ main ] | |
jobs: | |
build-and-deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up Python 3.9 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.9' | |
- 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/nwm_client_new[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 |