Skip to content

nightly update

nightly update #98

Workflow file for this run

name: nightly update
on:
workflow_dispatch:
schedule:
- cron: "0 0 * * *"
jobs:
catalog:
name: update catalog
runs-on: ubuntu-latest
steps:
- name: update catalog via ssh
uses: appleboy/ssh-action@v1.1.0
with:
command_timeout: 200m
host: ${{ secrets.SSH_HOST }}
username: ${{ secrets.SSH_USERNAME }}
key: ${{ secrets.SSH_PRIVATE_KEY }}
script: |
source /mnt/CORDEX_CMIP6_tmp/software/miniforge3/etc/profile.d/conda.sh
git clone git@github.com:euro-cordex/joint-evaluation.git /mnt/CORDEX_CMIP6_tmp/user_tmp/$USER/joint-evaluation
cd /mnt/CORDEX_CMIP6_tmp/user_tmp/$USER/joint-evaluation
ls
bash ci/create-env.sh code/environment.yaml jsc-cordex-remote
bash ci/update-catalog.sh
rm -rf /mnt/CORDEX_CMIP6_tmp/user_tmp/$USER/joint-evaluation
plots:
name: update plots
needs: catalog
runs-on: ubuntu-latest
steps:
- name: run analysis and plot scrips
uses: appleboy/ssh-action@v1.1.0
with:
command_timeout: 200m
host: ${{ secrets.SSH_HOST }}
username: ${{ secrets.SSH_USERNAME }}
key: ${{ secrets.SSH_PRIVATE_KEY }}
script: |
source /mnt/CORDEX_CMIP6_tmp/software/miniforge3/etc/profile.d/conda.sh
git clone git@github.com:euro-cordex/joint-evaluation.git /mnt/CORDEX_CMIP6_tmp/user_tmp/$USER/joint-evaluation
cd /mnt/CORDEX_CMIP6_tmp/user_tmp/$USER/joint-evaluation
ls
conda activate jsc-cordex-remote
#bash ci/create-env.sh code/environment.yaml jsc-cordex-remote
python code/timeseries.py
# Check if catalog.csv has changed
git diff --quiet plots/*
changed=$?
if [ $changed -ne 0 ]; then
echo "committing updates plots!"
git add plots/*
git commit --author="github-actions[bot] <github-actions[bot]@users.noreply.github.com>" -m "plot update"
git push origin main
else
echo "no change!"
fi
rm -rf /mnt/CORDEX_CMIP6_tmp/user_tmp/$USER/joint-evaluation