-
Notifications
You must be signed in to change notification settings - Fork 0
executable file
·40 lines (38 loc) · 1.26 KB
/
cardiff_newport_road.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
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
- 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