-
Notifications
You must be signed in to change notification settings - Fork 0
44 lines (37 loc) · 1.4 KB
/
data-to-dwc.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
name: Convert CSV files to Darwin Core compliant event and occurrence files
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]
jobs:
generate-data:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2 # Checkout branch into the runner
- uses: r-lib/actions/setup-r@master # Set up R runtime
with:
r-version: 'release'
- name: Setup renv # Set up R env to install packages
run: |
install.packages('remotes')
remotes::install_github("rstudio/renv")
shell: Rscript {0}
- uses: actions/cache@v2 # Cache packages so won't be compiled everytime job is run
with:
path: ~/.local/share/renv
key: ${{ runner.os }}-renv-${{ hashFiles('**/renv.lock') }}
restore-keys: |
${{ runner.os }}-renv-
- name: Install dependencies # Install the dependencies eg. Dplyr, tidyverse etc
run: renv::restore()
shell: Rscript {0}
- name: Generate data # Run the script
run: source("R/data_to_dwc.R")
shell: Rscript {0}
- name: Commit files # Commit changes
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Actions"
git add .
git diff-index --quiet HEAD || (git commit -m "update data" && git push)