forked from european-modelling-hubs/flu-forecast-hub_archive
-
Notifications
You must be signed in to change notification settings - Fork 0
71 lines (57 loc) · 1.8 KB
/
import_truth_erviss.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
name: "ImportTruthErviss"
on:
workflow_dispatch:
# scheduled run every Friday at 19.00 (18.00 UTC)
schedule:
- cron: '00 18 * * 5'
jobs:
import_truth_job:
if: github.repository_owner == 'european-modelling-hubs'
runs-on: ubuntu-latest
steps:
# Checkout the python tools repo
# -------------------------------------------
- name: checkout python tools repo
uses: actions/checkout@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
repository: 'european-modelling-hubs/hub-tools'
ref: 'main'
path: './tools/'
# Checkout the data repository
# -------------------------------------------
- name: checkout data repo
uses: actions/checkout@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
repository: 'european-modelling-hubs/flu-forecast-hub'
ref: 'main'
path: './repo/'
# Run Pyton code
# -------------------------
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- run: pip install pycountry isoweek
- name: Import Truth
id: import_truth
run: |
python ./repo/.github/scripts/import_truth.py
- name: Commit data repo changes
uses: EndBug/add-and-commit@v7
with:
cwd: './repo'
message: "Updating Truth Data repo ..."
default_author: github_actions
push: true
# Save changes to artifact for json db store
- name: Save changes to artifact
env:
imported_files: ${{ steps.import_truth.outputs.imported_files }}
run: |
echo "{ \"pr-changes\" : \"$imported_files\" }" > pr_changes.json
- name: Upload changes
uses: actions/upload-artifact@v2
with:
name: pr_changes
path: ./pr_changes.json