Skip to content

Commit

Permalink
Create data-to-dwc.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
smwoodman authored Sep 5, 2023
1 parent 95a20a9 commit d6a742d
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/data-to-dwc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,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)

0 comments on commit d6a742d

Please sign in to comment.