Cardiff Newport Road Air Quality Data #29040
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: Cardiff Newport Road Air Quality Data | |
on: | |
repository_dispatch: | |
schedule: | |
- cron: '10 2 * * *' | |
jobs: | |
scheduled: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out this repo | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.9 | |
- uses: actions/cache@v4 | |
name: Configure pip caching | |
with: | |
path: ~/.cache/pip | |
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} | |
restore-keys: | | |
${{ runner.os }}-pip- | |
- name: Install Python dependencies | |
run: | | |
pip install -r requirements.txt | |
- name: Fetch latest Cardiff Newport Road data | |
run: |- | |
cd cardiff_newport_road | |
# wget -O CNPR_NO_2023.csv https://uk-air.defra.gov.uk/datastore/data_files/site_pol_data/CNPR_NO_2023.csv | |
wget -O CNPR_NO_2024.csv https://uk-air.defra.gov.uk/datastore/data_files/site_pol_data/CNPR_NO_2024.csv | |
wget -O CNPR_NO_2025.csv https://uk-air.defra.gov.uk/datastore/data_files/site_pol_data/CNPR_NO_2025.csv | |
- name: Commit and push data if it changed | |
run: |- | |
git config user.name "Automated" | |
git config user.email "actions@users.noreply.github.com" | |
git add -A | |
timestamp=$(date -u) | |
git commit -m "Latest Cardiff Newport Road data: ${timestamp}" || exit 0 | |
git push |