CI chile games and dts stats #278
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: CI chile games and dts stats | |
# Controls when the workflow will run | |
on: | |
# Triggers the workflow based on the schedule: | |
schedule: | |
- cron: '0 0 * * *' | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | |
jobs: | |
# This workflow contains a single job called "update-data" | |
update-data: | |
# The type of runner that the job will run on | |
runs-on: ubuntu-latest | |
# Steps represent a sequence of tasks that will be executed as part of the job | |
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::rvest | |
any::dplyr | |
any::stringr | |
any::lubridate | |
any::readr | |
any::janitor | |
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | |
- name: Check out repository | |
uses: actions/checkout@v3 | |
# Runs the R code for data update | |
- name: Import data | |
run: Rscript -e 'source("update-data.R")' | |
# Runs a set of commands using the runners shell | |
- name: Commit results | |
run: | | |
git config --local user.email "[email protected]" | |
git config --local user.name "GitHub Actions" | |
git add chile_games.csv | |
git add chile_dts_stats.csv | |
git commit -m 'Data updated' || echo "No changes to commit" | |
git push origin || echo "No changes to commit" |