-
Notifications
You must be signed in to change notification settings - Fork 1
88 lines (75 loc) · 2.49 KB
/
proc_pull_box.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
82
83
84
85
86
87
88
name: NHL API pull data for game-level stats (games and odds)
on:
schedule:
- cron: '0 20 * * *' # This runs the workflow daily at 20:00 UTC, which is 3 PM CT during Daylight Saving Time
push:
branches:
- main
workflow_dispatch:
jobs:
update-and-commit:
runs-on: ubuntu-latest
environment: data-collection
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Conda - Set up Miniconda
uses: conda-incubator/setup-miniconda@v3
with:
auto-update-conda: true
python-version: '3.12.2' # Specify the Python version you need
channels: conda-forge,defaults # Add conda-forge and defaults channels
- name: Conda - Initialize Conda
run: |
conda init bash
source ~/.bashrc
- name: Conda - Create environment and install Conda dependencies
run: |
conda create --name myenv --yes
source ~/.bashrc
conda activate myenv
conda install --yes --file src/requirements/conda_requirements.txt
- name: Conda - Install Pip dependencies
run: |
source ~/.bashrc
conda activate myenv
pip install -r src/requirements/pip_requirements.txt
- name: Run Python - NHL Game Record Data
run: |
source ~/.bashrc
conda activate myenv
python src/data/apinhle/data_pull_box.py
- name: Run Python - NHL Odds Data
run: |
source ~/.bashrc
conda activate myenv
python src/data/apinhle/data_pull_box_odds.py
- name: Run Python - NHL Game-level Summary to Game Records and Season-team Statistics
if: always()
run: |
source ~/.bashrc
conda activate myenv
python src/data/apinhle/data_proc_gameSummary.py
- name: Run Python - NHL Game-level Play-by-play record data
if: always()
run: |
source ~/.bashrc
conda activate myenv
python src/data/apinhle/data_pull_plays.py
- name: Configure Git
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
- name: Commit and push changes
run: |
git add latest/box/*.csv
git add latest/team/season/*.csv
if git diff-index --quiet HEAD --; then
echo "No changes to commit"
exit 0
else
git commit -m 'Automated data update'
git push
fi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}