Skip to content

GridModel; HydroMT 0.9 compliant; Deprecated PCR; Ubuntu testing #423

GridModel; HydroMT 0.9 compliant; Deprecated PCR; Ubuntu testing

GridModel; HydroMT 0.9 compliant; Deprecated PCR; Ubuntu testing #423

Workflow file for this run

name: Build Documentation
on:
workflow_dispatch:
push:
branches: [main]
paths:
- tests/*
- hydromt_wflow/*
- docs/*
- examples/*
- pyproject.toml
pull_request:
branches: [main]
paths:
- tests/*
- hydromt_wflow/*
- docs/*
- examples/*
- pyproject.toml
jobs:
# Build docs on Linux
Docs:
defaults:
run:
shell: bash -l {0}
strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest" ] #, "macos-latest", "windows-latest"]
python-version: ['3.11']
include:
- os: ubuntu-latest
label: linux-64
prefix: /usr/share/miniconda3/envs/hydromt_wflow
name: ${{ matrix.label }}
runs-on: ${{ matrix.os }}
steps:
- name: Checkout source
uses: actions/checkout@v3
- name: Setup Mambaforge
uses: conda-incubator/setup-miniconda@v2
with:
python-version: ${{ matrix.python-version }}
miniforge-variant: Mambaforge
miniforge-version: latest
activate-environment: hydromt_wflow
use-mamba: true
- name: Generate env spec
run: |
pip install tomli
python make_env.py doc --py-version ${{ matrix.python-version }}.*
- name: Update environment
run: mamba env update -f environment.yml
- name: Install HydroMT-Wflow plugin
run: pip install .
- name: Generate dummy docs
if: ${{ github.event_name == 'pull_request' }}
run: |
export PATH=/usr/share/miniconda3/bin:$PATH
PYTHONPYCACHEPREFIX=~/pycache mamba run -n hydromt_wflow sphinx-build ./docs ./docs/_build -b dummy
- name: Generate docs
if: ${{ github.event_name != 'pull_request' && !github.event.act }}
run: |
export PATH=/usr/share/miniconda3/bin:$PATH
PYTHONPYCACHEPREFIX=~/pycache mamba run -n hydromt_wflow sphinx-build -M html ./docs ./docs/_build
echo "DOC_VERSION=$(mamba run -n hydromt_wflow 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/[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