refresh-data #291
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
schedule: | |
- cron: '0 */12 * * *' | |
name: refresh-data | |
jobs: | |
refresh-data: | |
runs-on: ubuntu-latest | |
env: | |
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | |
R_KEEP_PKG_SOURCE: yes | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: r-lib/actions/setup-r@v2 | |
with: | |
use-public-rspm: true | |
- uses: r-lib/actions/setup-pandoc@v2 | |
- name: install pak | |
run: Rscript -e 'install.packages("pak")' | |
- name: install idea.sources00 (includes package dependencies for examples and readme) | |
run: Rscript -e 'pak::pak(".", dependencies = TRUE)' | |
- name: run data getter | |
run: Rscript -e 'source("data-raw/run.R", echo = TRUE)' | |
- name: Render README | |
run: Rscript -e 'rmarkdown::render("README.Rmd")' | |
- name: cleanup | |
run: rm README.html | |
- name: Commit | |
run: | | |
git config --global user.name 'Michael Sumner' | |
git config --global user.email '[email protected]' | |
git add . | |
git commit -m 'refreshing data' || echo "No changes to commit" | |
git push || echo "No changes to commit" |