.github/workflows/update_yaml.yaml #50
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: | |
schedule: | |
- cron: '10 2 * * *' | |
workflow_dispatch: | |
branches: [ "main" ] | |
jobs: | |
render: | |
name: update_ | |
runs-on: ubuntu-latest | |
env: | |
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: r-lib/actions/setup-r@v2 | |
with: | |
use-public-rspm: true | |
- name: Install dependencies | |
run: | | |
install.packages(c("remotes", "pkgload", "pak")) | |
remotes::install_deps(dependencies = TRUE) | |
shell: Rscript {0} | |
- uses: r-lib/actions/setup-pandoc@v2 | |
- name: Execute Script | |
run: | | |
Rscript "inst/update_.R" | |
- name: Commit results | |
run: | | |
git config --local user.name "$GITHUB_ACTOR" | |
git config --local user.email "$GITHUB_ACTOR@users.noreply.github.com" | |
git add inst/base_readme.rda | |
git add README.md | |
git add README.Rmd | |
git commit -m 'Update data' || echo "Update data" | |
git push origin || echo "Update data" |