-
-
Notifications
You must be signed in to change notification settings - Fork 19
81 lines (70 loc) · 2.44 KB
/
weekly-playerids.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
on:
schedule:
- cron: 23 0 * * 5
workflow_dispatch:
name: weekly-playerids
jobs:
weekly-playerids:
runs-on: ubuntu-20.04
env:
RSPM: https://packagemanager.rstudio.com/cran/__linux__/focal/latest
GITHUB_PAT: ${{ secrets.GH_PAT }}
SCRAPEOPS_API_KEY: ${{ secrets.SCRAPEOPS_API_KEY }}
steps:
- name: Checkout public db repo
uses: actions/checkout@v2
with:
path: public
- name: Checkout private data 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
nflverse/nflreadr
- name: Update source player ID databases
working-directory: ./private
run: |
source("R/player_ids/update_mfl.R", chdir = TRUE)
source("R/player_ids/update_sleeper.R", chdir = TRUE)
source("R/player_ids/update_nflfastr_rosters.R", chdir = TRUE)
source("R/pfr/scrape_pfrids.R", chdir = TRUE)
shell: Rscript {0}
- name: Build dp_playerids
working-directory: ./private
run: |
source("R/player_ids/build_playerids.R", chdir = TRUE)
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