Collect AQI Data #518
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Collect AQI Data | |
on: | |
schedule: | |
- cron: '0 * * * *' # Every hour | |
workflow_dispatch: | |
jobs: | |
collect: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v4 | |
- name: Setup Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.10' | |
- name: Install dependencies | |
run: pip install requests pandas | |
- name: Run collector | |
env: | |
OPENWEATHER_API_KEY: ${{ secrets.OPENWEATHER_API_KEY }} | |
run: python aqi_collector.py | |
- name: Prepare docs | |
run: | | |
mkdir -p docs/data | |
cp data/aqi_data.csv docs/data/ | |
- name: Commit and push | |
run: | | |
git config --global user.name "GitHub Actions" | |
git config --global user.email "[email protected]" | |
git add . | |
git commit -m "Auto-update: $(date +'%Y-%m-%d %H:%M')" || echo "No changes" | |
git push |