Skip to content

Store advanced stats #142

Store advanced stats

Store advanced stats #142

name: Store advanced stats
# Controls when the action will run - have set this to run at:
# 02:15 on Tuesday, Thursday, and Sunday in
# January, February, March, April, May, August, September, October, November, and December.
on:
schedule:
- cron: "30 17 * 1-5,8-12 0,2,4"
# 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 "build"
update-adv-stats:
# The type of runner that the job will run on
runs-on: macOS-latest
# retrieve token
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- uses: r-lib/actions/setup-r@v2
- name: Package Installation
run: Rscript -e 'install.packages(c("tidyverse" ,"devtools", "dplyr", "stringr", "here", "piggyback"))'
- name: worldfootballR Package Installation
run: Rscript -e 'devtools::install_github("JaseZiv/worldfootballR")'
- name: Update advanced season stats
run: Rscript -e 'source(here::here("R", "fb_big5_advanced_season_stats", "update_big5_advanced_stats.R"), echo = TRUE)'
- name: Commit
run: |
git config --global user.name 'JaseZiv'
git config --global user.email '[email protected]'
git add .
git commit -m 'updating data' || echo "No changes to commit"
git push || echo "No changes to commit"