Update live election 2024 data #1136
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: '*/15 * * * *' #every 15th minute adjusted at 6a | |
#- cron: '1 1 1 1 *' #At 01:01 on day-of-month 1 in January | |
#- cron: '22 * * * *' #22 minutes past the hour | |
workflow_dispatch: | |
name: Update live election 2024 data | |
jobs: | |
render: | |
name: Get live data | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: r-lib/actions/setup-r@v2 | |
- name: Set up pandoc | |
uses: r-lib/actions/setup-pandoc@v2 | |
- name: Packages cache | |
uses: actions/cache@v3 | |
with: | |
path: ${{ env.R_LIBS_USER }} | |
key: ${{ runner.os }}-r-${{ hashFiles('**/DESCRIPTION') }} | |
restore-keys: ${{ runner.os }}-r- | |
- name: Rerun live data | |
run: Rscript scripts/2024-live-data.R | |
- name: Commit results | |
run: | | |
git add -A | |
git commit -m 'Live data updated' || echo "No changes" | |
git push origin || echo "No changes to commit" |