added option for absolute or relative damages #49
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 Documentation | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
permissions: | |
contents: write | |
jobs: | |
docs: | |
defaults: | |
run: | |
shell: bash -l {0} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: ["ubuntu-latest" ] | |
python-version: ["3.11"] | |
include: | |
- os: ubuntu-latest | |
label: linux-64 | |
prefix: /usr/share/miniconda3/envs/flood_adapt_docs | |
name: ${{ matrix.label }} | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: checkout code | |
uses: actions/checkout@v3 | |
- name: Setup Miniforge3 | |
uses: conda-incubator/setup-miniconda@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
miniforge-variant: Miniforge3 | |
miniforge-version: latest | |
use-mamba: true | |
- name: Setup env | |
run: | | |
pip install tomli | |
mamba env create --file=environment_docs.yml --force | |
- name: Setup quarto | |
run: | | |
sudo apt install -y curl | |
sudo apt install -y gdebi-core | |
mkdir tmp | |
curl -L https://github.com/quarto-dev/quarto-cli/releases/download/v1.3.450/quarto-1.3.450-linux-amd64.deb --output tmp/quarto.deb | |
chmod +x tmp/quarto.deb | |
sudo gdebi -n tmp/quarto.deb | |
# - name: Setup api -double check | |
# run: | | |
# export PATH=/usr/share/miniconda3/bin:$PATH | |
# mamba run -n floodadapt_docs python -m pip install tomli-w | |
# cd docs | |
# mamba run -n floodadapt_docs python api.py | |
# mamba run -n floodadapt_docs python -m quartodoc interlinks | |
- name: Generate docs | |
run: | | |
export PATH=/usr/share/miniconda3/bin:$PATH | |
source /usr/share/miniconda3/etc/profile.d/conda.sh | |
conda activate floodadapt_docs | |
quarto render docs/ --execute | |
echo "DOC_VERSION=$(mamba run -n floodadapt_docs python -c 'from floodadapt 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/actions-gh-pages@v3.9.3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./docs/_site | |
destination_dir: ./${{ env.DOC_VERSION }} | |
keep_files: false | |
full_commit_message: Deploy ${{ env.DOC_VERSION }} to GitHub Pages |