Skip to content

update_adv_stats

update_adv_stats #196

on:
workflow_dispatch:
schedule:
# runs every day at 7:00 AM UTC in Jan, Feb, Sep-Dec
- cron: '0 7 * 1,2,9-12 *'
name: update_adv_stats
jobs:
pfr_advstats:
runs-on: ${{ matrix.config.os }}
name: ${{ matrix.config.os }} (${{ matrix.config.r }})
strategy:
fail-fast: false
matrix:
config:
- {os: ubuntu-latest, r: 'release'}
env:
GITHUB_PAT: ${{ secrets.NFLVERSE_GH_TOKEN }}
SCRAPEOPS_API_KEY: ${{ secrets.NFLVERSE_SCRAPEOPS_API_KEY }}
R_KEEP_PKG_SOURCE: yes
steps:
- uses: actions/checkout@v2
- uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.config.r }}
http-user-agent: ${{ matrix.config.http-user-agent }}
use-public-rspm: true
- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: |
local::.
nflverse/nflverse-data
nflverse/undercover
ropensci/piggyback
- name: Run update script
run: Rscript -e 'source("auto/update_adv_stats.R")'
- name: Run update script
run: Rscript -e 'source("auto/update_adv_season_stats.R")'
# - name: Commit updated data
# run: |
# git config --local user.email "[email protected]"
# git config --local user.name "GitHub Actions"
# git pull
# git add data/adv_stats
# git commit -m "Automated advanced stats scrape `date`" || echo "No changes to commit"
# git push || echo "No changes to commit"