-
Notifications
You must be signed in to change notification settings - Fork 9
58 lines (50 loc) · 1.56 KB
/
update_truth_data.yml
File metadata and controls
58 lines (50 loc) · 1.56 KB
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
name: Update Truth Data
on:
workflow_dispatch:
schedule:
- cron: '0 9 * * 1'
jobs:
update_target-data:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v3
with:
fetch-depth: 1
sparse-checkout: |
.github
src
auxiliary-data/data-locations
auxiliary-data/target-data_archive
target-data
- uses: r-lib/actions/setup-r@v2
- name: Install system dependencies
run: sudo apt-get install libcurl4-openssl-dev libharfbuzz-dev libfribidi-dev libarchive-dev libudunits2-dev libgdal-dev libfontconfig1-dev
- name: Cache R packages
id: cache
if: runner.os != 'Windows'
uses: actions/cache@v3
with:
path: ${{ env.R_LIBS_USER }}
key: ${{ runner.os }}-${{ hashFiles('.github/requirements.txt') }}-1
- name: Install dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: |
R -e 'install.packages(c("dplyr", "tidyr", "stringr", "httr", "MMWRweek", "jsonlite", "purrr"))'
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
- name: Generate truth csv files
run: |
R -e 'source("src/target-data.R")'
- name: Commit
run: |
git config user.name Github-Actions
git config user.email "<>"
if [ -n "$(git status --porcelain)" ]; then
git add .
git commit -m "Target data update $(date)"
git push
echo "Target data updated";
else
echo "no updates";
fi