-
Notifications
You must be signed in to change notification settings - Fork 0
executable file
·41 lines (39 loc) · 1.34 KB
/
cardiff_central.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
name: Cardiff Central Air Quality Data
on:
repository_dispatch:
schedule:
- cron: '00 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 Central data
run: |-
cd cardiff_central
#wget -q -O CARD_2022.csv https://uk-air.defra.gov.uk/datastore/data_files/site_data/CARD_2022.csv
#wget -q -O CARD_2023.csv https://uk-air.defra.gov.uk/datastore/data_files/site_data/CARD_2023.csv
wget -q -O CARD_2024.csv https://uk-air.defra.gov.uk/datastore/data_files/site_data/CARD_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 Central data: ${timestamp}" || exit 0
git push