Stable version of the fiat_integrator #116
Workflow file for this run
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 | |
# 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@v2 | |
# - name: Get tags | |
# run: git fetch --depth=1 origin +refs/tags/*:refs/tags/* | |
- name: Setup environment | |
uses: conda-incubator/setup-miniconda@v2 | |
with: | |
python-version: "3.9" | |
mamba-version: "*" | |
channels: conda-forge,defaults | |
channel-priority: true | |
environment-file: envs/hydromt-fiat-dev.yml | |
activate-environment: hydromt-fiat-dev | |
- name: Install hydromt-fiat | |
run: flit install | |
# Move examples folder before make html for nbsphinx | |
- name: Build docs | |
run: | | |
mv examples docs/_examples | |
pushd docs | |
make html | |
popd | |
# This overrides the version "dev" with the proper version if we're building off a | |
# branch that's not main (which is confined to n.nn.x above) or on a tag. | |
- name: Set doc version | |
if: ${{ github.event_name != 'push' || !contains(github.ref, 'main') }} | |
run: echo "DOC_VERSION=$(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'}} | |
uses: peaceiris/[email protected] | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./docs/_build/html | |
exclude_assets: '.buildinfo,_sources/*' | |
destination_dir: ./${{ env.DOC_VERSION }} | |
keep_files: false | |
full_commit_message: Deploy ${{ env.DOC_VERSION }} to GitHub Pages |