-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #185 from Deltares/docs
Update with working docs workflow
- Loading branch information
Showing
10 changed files
with
538 additions
and
73 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
name: Build Documentation | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: [ main ] | ||
paths: | ||
|
@@ -39,50 +40,23 @@ jobs: | |
miniforge-variant: Mambaforge | ||
miniforge-version: latest | ||
channels: conda-forge | ||
activate-environment: hydromt-fiat-docs | ||
use-mamba: true | ||
|
||
- name: load from cache | ||
id: cache | ||
uses: actions/cache/restore@v3 | ||
with: | ||
path: | | ||
/usr/share/miniconda3 | ||
~/pycache | ||
./docs/_build | ||
# the below two settings mean we'll alway srestore the cache | ||
# but the cache hit output can tell us if we have to update afterwards | ||
key: docs-${{ hashFiles('envs/hydromt-fiat-docs.yml') }} | ||
restore-keys: | | ||
docs | ||
- name: Fail on no cache restore | ||
if: steps.cache.outputs.cache-matched-key == '' | ||
run: | | ||
echo "Failed to restore any cache. exiting..." | ||
exit 1 | ||
# by avoiding the mamba setup stage by loading it from cache instead we save | ||
# a lot of setup time, but we do have to do our own PATH management | ||
# hence the exports | ||
- name: Update environment | ||
if: steps.cache.outputs.cache-hit != 'true' | ||
- name: Install and activate environment | ||
run: | | ||
export PATH=/usr/share/miniconda3/bin:$PATH | ||
mamba env update -n hydromt-fiat-docs -f envs/hydromt-fiat-docs.yml | ||
- name: Install hydromt-fiat | ||
run: pip install . | ||
mamba env create -f envs/hydromt-fiat-docs.yml | ||
conda activate hydromt-fiat-docs | ||
pip install . | ||
- name: Generate docs | ||
# if: ${{ github.event_name != 'pull_request' && !github.event.act }} | ||
if: ${{ github.event_name != 'pull_request' && !github.event.act }} | ||
run: | | ||
export PATH=/usr/share/miniconda3/bin:$PATH | ||
PYTHONPYCACHEPREFIX=~/pycache mamba run -n hydromt-fiat-docs sphinx-build -M html ./docs ./docs/_build | ||
echo "DOC_VERSION=$(mamba run -n hydromt-fiat-docs python -c 'from hydromt_fiat 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' && !github.event.act }} | ||
if: ${{ github.event_name != 'pull_request' && !github.event.act }} | ||
uses: peaceiris/[email protected] | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
|
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,6 +18,7 @@ dependencies: | |
- pip | ||
- pyogrio | ||
- pydata-sphinx-theme | ||
- python=3.10 | ||
- rasterio | ||
- requests | ||
- rioxarray | ||
|
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,7 @@ authors = [ | |
{name = "Mario Fuentes Monjaraz", email = "[email protected]"}, | ||
{name = "Luis Rodriguez Galvez", email = "[email protected]"}, | ||
{name = "Lieke Meijer", email = "[email protected]"}, | ||
{name = "Sarah Rautenbach", email = "[email protected]"}, | ||
] | ||
requires-python = ">=3.8" | ||
dependencies = [ | ||
|