Skip to content

Annual Roster Update #30

Annual Roster Update

Annual Roster Update #30

name: Annual Roster Update
on:
workflow_dispatch:
schedule:
- cron: '5 4 1 1-8 *'
- cron: '30 8 * 9-12 SUN'
- cron: '0 16 * 9-12 SAT'
- cron: '15 20 * 9-12 SAT'
- cron: '5 4 * 1,12 *'
jobs:
update:
runs-on: ubuntu-20.04
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
CFBD_API_KEY: ${{ secrets.CFBD_API_KEY }}
CRAN_REPO: https://packagemanager.rstudio.com/all/__linux__/bionic/latest
strategy:
matrix:
r-version: [4.2.0]
steps:
- uses: actions/checkout@v4
- name: Set up R ${{ matrix.r-version }}
uses: r-lib/actions/setup-r@v2
with:
r-version: '4.2.0'
- name: Install libcurl
run: sudo apt-get install libcurl4-openssl-dev libssl-dev libicu-dev libxml2-dev
- uses: r-lib/actions/setup-pandoc@v2
- name: Install dependencies
run: |
install.packages(c("remotes","ggplot2","ggrepel","stringr","attempt","assertthat","nnet","mgcv","rlang","tibble","geosphere","glue","maps","janitor", "jsonlite","dplyr","purrr","arrow", "tidyr", "readr"))
remotes::install_github("sportsdataverse/cfbfastR")
shell: Rscript {0}
- name: Run annual roster update
run: Rscript "add_rosters.R"
- name: Commit files
run: |
git config --local user.email "[email protected]"
git config --local user.name "Github Action"
git pull
git add .
git commit -m "Annual team roster update" || echo "No changes to commit"
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}