Skip to content

weekly-playervalues #128

weekly-playervalues

weekly-playervalues #128

on:
schedule:
- cron: 23 2 * * 5
workflow_dispatch:
name: weekly-playervalues
jobs:
weekly-playervalues:
runs-on: ubuntu-22.04
env:
RSPM: https://packagemanager.rstudio.com/cran/__linux__/jammy/latest
GITHUB_PAT: ${{ secrets.GH_PAT }}
steps:
- name: Checkout public db repo
uses: actions/checkout@v2
with:
path: public
- name: Checkout private db repo
uses: actions/checkout@v2
with:
path: private
repository: dynastyprocess/db
token: ${{ secrets.GH_PAT }}
- name: Install R
uses: r-lib/actions/setup-r@v2
id: install-r
- uses: r-lib/actions/setup-r-dependencies@v2
with:
cache-version: 1
working-directory: ./private
extra-packages: ffverse/ffscrapr
- name: Build Values
working-directory: ./private
run: |
source("R/values/build_pickecr.R")
source("R/values/build_playerecr.R")
source("R/values/build_values.R")
shell: Rscript {0}
- name: Save private data
working-directory: ./private
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Actions"
git pull
git add data
git commit -m "Automated Player ID pipeline scrape `date`" || echo "No changes to commit"
git push origin main || echo "No changes to commit"
- name: Save public data
working-directory: ./public
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Actions"
git pull
git add files
git commit -m "Automated Player ID pipeline `date`" || echo "No changes to commit"
git push origin master || echo "No changes to commit"
- name: Upload log results
if: failure()
uses: actions/upload-artifact@main
with:
name: scrape-logs
path: ./private/scrape-log.txt