generated from OxfordIHTM/ihtm-targets-template
-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (42 loc) · 1.48 KB
/
deploy-targets-downloads.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
name: deploy targets download
on:
schedule:
- cron: "0 7 * * *"
workflow_dispatch:
jobs:
deploy-targets-download:
runs-on: ubuntu-latest
container: rocker/tidyverse:4.4.1
steps:
- uses: actions/checkout@v4
- name: Install system dependencies
run: |
apt-get update && apt-get install -y --no-install-recommends \
libxt6 libglpk-dev libpoppler-cpp-dev libmagick++-dev \
libtesseract-dev libleptonica-dev tesseract-ocr-eng
- name: Trust git repo
run: |
git config --global --add safe.directory /__w/paglaom/paglaom
- name: Install packages from renv.lock (with cache)
if: ${{ !env.ACT }}
uses: r-lib/actions/setup-renv@v2
with:
cache-version: 2
- name: Install packages from renv.lock (local, no cache)
if: ${{ env.ACT }}
run: |
renv::restore()
shell: Rscript {0}
- name: Run workflow
run: |
targets::tar_make(dam_level_data_raw_csv)
targets::tar_make(forecasts_download_files)
targets::tar_make(forecasts_agriculture_download_files)
shell: Rscript {0}
- name: Commit and push files
run: |
git config --global user.email "ernest@guevarra.io"
git config --global user.name "ernestguevarra"
git add .
git diff-index --quiet HEAD || git commit -m "get daily dam level data"
git push