Skip to content

Commit

Permalink
setting up github actions for data
Browse files Browse the repository at this point in the history
  • Loading branch information
guslipkin committed Apr 7, 2024
1 parent a07ed8f commit 5ff6c04
Show file tree
Hide file tree
Showing 4 changed files with 118 additions and 72 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/refresh_data.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
on:
push:
branches: main
schedule:
cron: '00 03 * * *'

jobs:
import-data:
runs-on: ubuntu-latest
steps:
- name: Set up R
uses: r-lib/actions/setup-r@v2

- name: Install packages
uses: r-lib/actions/setup-r-dependencies@v2
with:
packages: |
any::dplyr
any::googlesheets4
any::janitor
any::purrr
any::readr
any::stats
any::stringr
any::tibble
any::tidyr
any::tidyselect
any::usethis
- name: Check out repository
uses: actions/checkout@v3

- name: Import data
run: Rscript -e 'source("data-raw/external-data.R")'
- name: Refresh data
run: Rscript -e 'source("data-raw/internal-data.R")'

- name: Commit results
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Actions"
git add 'data-raw/data.csv' 'R/sysdata.rda'
git commit -m 'Data updated' || echo "No changes to commit"
git push origin || echo "No changes to commit"
Binary file modified R/sysdata.rda
Binary file not shown.
Loading

0 comments on commit 5ff6c04

Please sign in to comment.