-
Notifications
You must be signed in to change notification settings - Fork 1
46 lines (37 loc) · 1.42 KB
/
run_daily.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
name: Run Jupyter Notebook
on:
schedule:
- cron: '0 16 * * *' # Runs every day at 4 PM UTC
workflow_dispatch: # Allows manual triggering of the workflow
jobs:
execute-notebook:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.9' # Specify the Python version you need
- name: Install dependencies
run: |
pip install -r requirements.txt
pip install nbconvert jupyter ipykernel
- name: Set up Jupyter kernel
run: |
python -m ipykernel install --user --name python3 --display-name "Python 3"
- name: Execute notebook
run: |
mkdir -p graphics # Create directory for images if it doesn't exist
jupyter nbconvert --to notebook --execute barcelonadori_map.ipynb --output barcelonadori_map.ipynb --inplace
- name: Configure Git
run: |
git config --local user.name "GitHub Actions"
git config --local user.email "[email protected]"
- name: Commit and push changes
run: |
git add barcelonadori_map.ipynb graphics/* # Include saved images
git commit -m "Update barcelonadori_map.ipynb and graphics with latest data"
git push
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}