-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (57 loc) · 2.15 KB
/
remote.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
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