winter update #2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# run every 1st February | |
name: winter update | |
on: | |
schedule: | |
- cron: '0 12 1 2 *' | |
jobs: | |
autoscrape: | |
# The type of runner that the job will run on | |
runs-on: macos-latest | |
# Load repo and install R | |
steps: | |
- uses: actions/checkout@master | |
- uses: r-lib/actions/setup-r@master | |
# Set-up R | |
- name: Install packages | |
run: | | |
R -e 'install.packages("rvest")' | |
R -e 'install.packages("dplyr")' | |
R -e 'install.packages("readr")' | |
R -e 'install.packages("purrr")' | |
R -e 'install.packages("janitor")' | |
R -e 'install.packages("stringr")' | |
R -e 'install.packages("glue")' | |
# Run R script | |
- name: get winter transfers for latest season | |
run: Rscript src/scrape-winter.R | |
# Add new files in data folder, commit along with other modified files, push | |
- name: Commit files | |
run: | | |
git config --local user.name actions-user | |
git config --local user.email "actions@github.com" | |
git add data/* | |
git commit -am "winter update $(date)" | |
git push origin master | |
env: | |
REPO_KEY: ${{secrets.GITHUB_TOKEN}} | |
username: github-actions |