-
Notifications
You must be signed in to change notification settings - Fork 1
56 lines (48 loc) · 1.58 KB
/
main.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
name: AWS data downloader
on:
schedule:
- cron: "0 23 */1 * *" # Every day at 23:00 UTC
workflow_dispatch:
jobs:
download-data:
runs-on: ubuntu-latest
steps:
- name: Install ubuntu dependencies
run: |
sudo apt-get update
sudo apt-get install libcurl4-openssl-dev pandoc -y
- uses: actions/checkout@v2
- uses: r-lib/actions/setup-r@master
with:
r-version: 'release'
- name: Setup renv
run: |
install.packages('renv')
shell: Rscript {0}
- uses: actions/cache@v2
with:
path: ~/.local/share/renv
key: ${{ runner.os }}-renv-${{ hashFiles('**/renv.lock') }}
restore-keys: |
${{ runner.os }}-renv-
- name: Install dependencies
run: renv::restore()
shell: Rscript {0}
- name: Run AWS data downloader for meteo
run: source("R/get_meteo_data_from_aws.R")
shell: Rscript {0}
- name: Run AWS data downloader for tide
run: source("R/get_tide_data.R")
shell: Rscript {0}
- name: Run data processing
run: source("R/data_processing.R")
shell: Rscript {0}
- name: Run dashboard builder
run: source("R/dashboard_builder.R")
shell: Rscript {0}
- name: Commit files
run: |
git config --local user.email "actions@github.com"
git config --local user.name "GitHub Actions"
git add .
git diff-index --quiet HEAD || (git commit -m "update data" && git push)