This repository has been archived by the owner on May 13, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
48 lines (42 loc) · 1.76 KB
/
update.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
42
43
44
45
46
47
48
name: 'Update data'
on:
schedule:
# Run hourly at **:30. Although the RKI claims to update the
# spreadsheet “every working day by noon”, there have been uploads
# that happened after noon, and sometimes multiple uploads on a
# single day.
# https://www.rki.de/DE/Content/InfAZ/N/Neuartiges_Coronavirus/Daten/Impfquoten-Tab.html
- cron: '30 * * * *'
workflow_dispatch:
jobs:
update-data:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
ref: ${{ github.head_ref }}
- name: Read .nvmrc
run: echo ::set-output name=NVMRC::$(cat .nvmrc)
id: nvm
- name: Set up Node.js
uses: actions/setup-node@v1
with:
node-version: '${{ steps.nvm.outputs.NVMRC }}'
- name: Install dependencies
run: npm install
- name: Update data
run: |
npm run build
git config user.name 'Mathias Bynens'
git config user.email '[email protected]'
# Update delivery data.
delivery=$(tail -n 1 data/deliveries.csv | cut -d',' -f 1)
git commit data/deliveries.csv -m "Import delivery data for ${delivery}" || true
# Update data on administered vaccine doses.
date=$(tail -n 1 data/data.csv | cut -d',' -f 1)
pubDate=$(tail -n 1 data/data.csv | cut -d',' -f 2)
git commit data/data.csv data/doses-per-day.csv data/national-total.csv -m "Import vaccination data for date=${date} × pubDate=${pubDate}" || true
git commit README.md -m "Update data anomalies per date=${date} × pubDate=${pubDate}" || true
git commit index.html -m "Update charts per date=${date} × pubDate=${pubDate} × delivery=${delivery}" || true
git push