Skip to content

gh action updates

gh action updates #3

Workflow file for this run

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@v3
- uses: r-lib/actions/setup-r@v2
with:
r-version: 'renv'
- uses: r-lib/actions/setup-renv@v2
- uses: actions/cache@v3 # 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: Cache packages
uses: actions/cache@v3
with:
path: ~/.local/share/renv
key: ${{ runner.os }}-renv-${{ hashFiles('**/renv.lock') }}
restore-keys: |
${{ runner.os }}-renv-
- name: Restore packages
shell: Rscript {0}
run: |
if (!requireNamespace("renv", quietly = TRUE)) install.packages("renv")
renv::restore()
- 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)