Skip to content

.github/workflows/DownloadStatcastData.yml #103

.github/workflows/DownloadStatcastData.yml

.github/workflows/DownloadStatcastData.yml #103

on:
schedule:
- cron: 42 15 * 3-11 *
workflow_dispatch:
jobs:
download-data:
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Set Up R
uses: r-lib/actions/setup-r@v2
- name: Install CRAN Dependencies
uses: r-lib/actions/setup-r-dependencies@v2
with:
packages: |
any::geomtextpath
any::remotes
any::httr
any::rvest
any::tidyverse
any::lsa
- name: Install BaseballR from GitHub
run: remotes::install_github("BillPetti/baseballr")
shell: Rscript {0}
- name: Install Analyzing Baseball Data With R package
run: remotes::install_github("beanumber/abdwr3edata")
shell: Rscript {0}
- name: Checkout repository
uses: actions/checkout@v3
- name: Run download script
run: Rscript StatcastDownload.R
- name: Run PitcherSim script
run: Rscript PitcherSims.R
- name: Run HotColdStreaks script
run: Rscript HotColdStreaks.R
- name: commit
run: |
git config --local user.name "$GITHUB_ACTOR"
git config --local user.email "[email protected]"
git add \*.csv
git commit -m 'Daily Statcast data file and PitcherSims'
git push