-
Notifications
You must be signed in to change notification settings - Fork 15
58 lines (52 loc) · 1.66 KB
/
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
57
58
name: Build Docs
# We don't want pushes (or PRs) to gh-pages to kick anything off
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
# Build docs on Linux
Docs:
name: linux docs
runs-on: ubuntu-latest
env:
DOC_VERSION: dev
defaults:
run:
shell: bash -l {0}
steps:
- name: Checkout source
uses: actions/checkout@v3
- name: install tomli
run: pip install tomli
- name: Generate env spec
run: python make_env.py doc
- name: Setup environment
uses: conda-incubator/setup-miniconda@v2
with:
python-version: "3.9"
miniforge-variant: Mambaforge
channels: conda-forge,defaults
channel-priority: strict
environment-file: environment.yml
activate-environment: hydromt-wflow
- name: Install HydroMT-Wflow plugin
run: pip install .
- name: Build docs
run: |
pushd docs
make html
popd
- name: Set doc version
run: echo "DOC_VERSION=$(python -c 'from hydromt_wflow import __version__ as v; print("dev" if "dev" in v else "v"+v.replace(".dev",""))')" >> $GITHUB_ENV
- name: Upload to GitHub Pages
if: ${{ github.event_name != 'pull_request'}}
uses: peaceiris/actions-gh-pages@v3.8.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs/_build/html
exclude_assets: '.buildinfo,_sources/*,_examples/*.ipynb'
destination_dir: ./${{ env.DOC_VERSION }}
keep_files: false
full_commit_message: Deploy ${{ env.DOC_VERSION }} to GitHub Pages