-
-
Notifications
You must be signed in to change notification settings - Fork 0
37 lines (30 loc) · 933 Bytes
/
Copy pathairupdate.yml
File metadata and controls
37 lines (30 loc) · 933 Bytes
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
name: Update Air Quality Data
on:
schedule:
- cron: '0 */4 * * *' # Runs every 4 hours
workflow_dispatch:
jobs:
update-data:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x' # Replace with your desired Python version
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install requests
- name: Run Python script
env:
AIR_QUALITY_API_KEY: ${{ secrets.AIR_QUALITY_API_KEY }}
run: python air_quality.py
- name: Commit changes
run: |
git config --local user.email "actions@github.com"
git config --local user.name "GitHub Actions"
git add data.json
git commit -m "Update data.json" -a
git push