-
Notifications
You must be signed in to change notification settings - Fork 1
67 lines (57 loc) · 1.83 KB
/
proc_pull_player.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
name: NHL API pull data for player-level stats
on:
schedule:
- cron: '0 8 * * 1' # This runs the workflow at 8:00 AM UTC every Monday
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 Player Record Data
run: |
source ~/.bashrc
conda activate myenv
python src/data/apinhle/data_pull_player.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/player/*.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 }}