-
Notifications
You must be signed in to change notification settings - Fork 0
92 lines (71 loc) · 2.61 KB
/
notebook_runner.yml
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
name: run notebooks
# push or on schedule
on:
schedule:
- cron: '0 17 * * *' # Every day at 5pm UTC - early am AuSIS time
push:
workflow_dispatch:
jobs:
# This workflow contains a single job called "build"
compute:
name: Run notebook and upload result.
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- name: Cache conda
uses: actions/cache@v1
env:
# Increase this value to reset cache if etc/example-environment.yml has not changed
CACHE_NUMBER: 0
with:
path: |
~/conda_pkgs_dir
~/.cache/pip
key: ubuntu-seismo-conda-${{ env.CACHE_NUMBER }}-${{ hashFiles('.environment.yml') }}
- name: Miniconda + Cache
uses: conda-incubator/setup-miniconda@v2
with:
miniconda-version: "latest"
environment-file: environment.yml
activate-environment: ausis
python-version: 3.7
use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly!
- name: Install dependencies with conda # (the shell line is needed for conda paths etc)
shell: bash -l {0}
run: |
pip install tables
conda info
conda list
- name: Run the code
shell: bash -l {0}
run: |
./notebook_runner.sh &> output_log.txt
ls -l workdir # add this to the logs for debugging / monitoring
- name: Upload the log files (for now just an artifact)
if: always() # upload any output if above fails
continue-on-error: true # Usually indicates nothing has change / nothing nees to be committed.
uses: actions/upload-artifact@v1
with:
name: logs
path: output_log.txt
- name: Upload the image files
uses: actions/upload-artifact@v1
with:
name: figures-etc
path: results
- name: Commit files
continue-on-error: true # Usually indicates nothing has change / nothing nees to be committed.
run: |
git config --local user.email "[email protected]"
git config --local user.name "ProfessorDiablobot"
git add results/*.png
git add data/*npz
git add results/*.csv
git commit -m "Updated results: `date` "
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}