Skip to content

OSM tiling

OSM tiling #1323

Workflow file for this run

---
name: Build Documentation
on:
push:
branches: [main]
paths:
- tests/*
- hydromt/*
- data/*
- docs/*
- examples/*
- pyproject.toml
pull_request:
branches: [main]
paths:
- tests/*
- hydromt/*
- data/*
- docs/*
- examples/*
- pyproject.toml
jobs:
Docs:
name: linux docs
runs-on: ubuntu-latest
env:
DOC_VERSION: dev
defaults:
run:
shell: bash -l {0}
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
timeout-minutes: 15
steps:
- name: checkout code
uses: actions/checkout@v3
- name: Setup Mambaforge
uses: conda-incubator/setup-miniconda@v2
with:
python-version: 3.11
miniforge-variant: Mambaforge
miniforge-version: latest
channels: conda-forge
activate-environment: hydromt
use-mamba: true
- name: Generate env spec
run: python make_env.py doc
- name: Set cache date
run: echo "DATE=$(date +'%Y%m%d')" >> $GITHUB_ENV
- name: load from cache if it exists for our environment
uses: actions/cache@v3
with:
path: /usr/share/miniconda3/envs/hydromt
key: docs-conda-${{ hashFiles('environment.yml') }}-${{ env.DATE }}
id: cache
- name: Update environment & write to cache
run: mamba env update -n hydromt -f environment.yml
if: steps.cache.outputs.cache-hit != 'true'
- name: Install hydromt
run: pip install .
- name: test docs
if: ${{ github.event_name == 'pull_request' }}
run: |
make html_test
- name: Build docs
if: ${{ github.event_name != 'pull_request' && !github.event.act }}
run: |
make html
- name: Set doc version
run: echo "DOC_VERSION=$(python -c 'from hydromt 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 }}
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