-
Notifications
You must be signed in to change notification settings - Fork 66
128 lines (117 loc) · 3.79 KB
/
update_data.yaml
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
on:
schedule:
# Every day at 9:00 UTC/5:00 ET
- cron: '0 9 * 1,2,9-12 *'
# TNF 5:30 AM UTC / 12:30 AM ET
- cron: '30 5 * 1,2,9-12 5'
# Early window: 10:00 PM UTC / 5:00 PM ET
- cron: '00 22 * 1,2,9-12 0'
# Late window: 0:00 UTC / 8:00 ET
- cron: '5 0 * 1,2,9-12 1'
# SNF/MNF: 5:30 UTC / 12:30 ET
- cron: '30 5 * 1,2,9-12 1'
- cron: '30 5 * 1,2,9-12 2'
workflow_dispatch:
inputs:
full_rebuild:
description: 'Full Rebuild'
required: true
default: false
type: boolean
name: Update PBP Related Data
jobs:
pbp_setup:
runs-on: ubuntu-latest
name: pbp_setup
env:
GH_TOKEN: ${{ secrets.NFLVERSE_GH_TOKEN }}
outputs:
seasons: ${{ steps.query_seasons.outputs.seasons }}
steps:
- id: query_seasons
run: |
if [ ${{ inputs.full_rebuild }} == false ]
then
echo "seasons=$(gh release list -R nflverse/nflverse-pbp --json tagName --jq '[[.[].tagName | match("\\d+") | .string ] | max]')" > "$GITHUB_OUTPUT"
else
echo "seasons=$(gh release list -R nflverse/nflverse-pbp --json tagName --jq '[.[].tagName | match("\\d+") | .string ]')" > "$GITHUB_OUTPUT"
fi
update_pbp:
needs: pbp_setup
name: Update ${{ matrix.season }} ${{ matrix.type }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
season: ${{ fromJson(needs.pbp_setup.outputs.seasons) }}
type: ["pbp", "pbp_stats", "laterals"]
env:
GITHUB_PAT: ${{ secrets.NFLVERSE_GH_TOKEN }}
NFLVERSE_UPDATE_SEASON: ${{ matrix.season }}
NFLVERSE_UPDATE_TYPE: ${{ matrix.type }}
steps:
- uses: actions/checkout@v4
- uses: r-lib/actions/setup-r@v2
- uses: r-lib/actions/setup-r-dependencies@v2
with:
cache-version: 1
extra-packages: |
nflverse/nflfastR
nflverse/nflreadr
nflverse/nflverse-data
nflverse/fastrmodels
ropensci/piggyback
- name: Release ${{ matrix.type }}
run: Rscript -e 'source("R/update_data.R")'
update_stats:
needs: [pbp_setup, update_pbp]
name: Update ${{ matrix.season }} ${{ matrix.type }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
season: ${{ fromJson(needs.pbp_setup.outputs.seasons) }}
type: ["ps_off", "ps_def", "ps_kick", "participation"]
env:
GITHUB_PAT: ${{ secrets.NFLVERSE_GH_TOKEN }}
NFLVERSE_UPDATE_SEASON: ${{ matrix.season }}
NFLVERSE_UPDATE_TYPE: ${{ matrix.type }}
steps:
- uses: actions/checkout@v4
- uses: r-lib/actions/setup-r@v2
- uses: r-lib/actions/setup-r-dependencies@v2
with:
cache-version: 1
extra-packages: |
nflverse/nflfastR
nflverse/nflreadr
nflverse/nflverse-data
nflverse/fastrmodels
ropensci/piggyback
- name: Release ${{ matrix.type }}
run: Rscript -e 'source("R/update_data.R")'
combine_stats:
needs: [pbp_setup, update_stats]
name: Combine ${{ matrix.type }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
type: ["ps_off_comb", "ps_def_comb", "ps_kick_comb"]
env:
GITHUB_PAT: ${{ secrets.NFLVERSE_GH_TOKEN }}
NFLVERSE_UPDATE_TYPE: ${{ matrix.type }}
steps:
- uses: actions/checkout@v4
- uses: r-lib/actions/setup-r@v2
- uses: r-lib/actions/setup-r-dependencies@v2
with:
cache-version: 1
extra-packages: |
nflverse/nflfastR
nflverse/nflreadr
nflverse/nflverse-data
nflverse/fastrmodels
ropensci/piggyback
- name: Release ${{ matrix.type }}
run: Rscript -e 'source("R/update_data.R")'