update-datasets #108
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
name: update-datasets | |
on: | |
schedule: | |
- cron: '0 14 * * 1' # 2pm UTC / 8am CST Mondays | |
workflow_dispatch: | |
jobs: | |
update-datasets: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
ref: main | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- uses: r-lib/actions/setup-r@v2 | |
with: | |
r-version: release | |
use-public-rspm: true | |
- uses: r-lib/actions/setup-r-dependencies@v2 | |
with: | |
extra-packages: any::gert, any::fs, any::here | |
- name: Update data | |
run: Rscript data-raw/just-new.R | |
- name: 🚀 Commit | |
run: | | |
git config user.name "github-actions" | |
git config user.email "[email protected]" | |
git add --all | |
if git diff --cached --quiet; then | |
echo "No changes to commit." | |
else | |
git commit -m "🤖 Auto-update internal data" | |
git push | |
fi |