29 adapt 2d boundary #446
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: Build Docs | |
# Also build for PR's since this also tests whether all notebooks run properly | |
# However, do not upload to gh-pages if built from PR | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
jobs: | |
# Build docs on Linux | |
Docs: | |
name: build docs | |
runs-on: ubuntu-latest | |
env: | |
DOC_VERSION: dev | |
defaults: | |
run: | |
shell: bash -l {0} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup environment | |
uses: conda-incubator/setup-miniconda@v3 | |
with: | |
python-version: "3.11" | |
channels: conda-forge | |
channel-priority: strict | |
- name: Install hydromt-delft3dfm | |
run: | | |
conda install flit | |
conda install pandoc # does not work via pip | |
flit install | |
- name: list env contents | |
run: | | |
pip list | |
hydromt --models | |
- name: Build docs | |
run: | | |
pushd docs | |
make html | |
popd | |
- name: Set doc version | |
run: echo "DOC_VERSION=$(python -c 'from hydromt_delft3dfm 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/[email protected] | |
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 |