-
Notifications
You must be signed in to change notification settings - Fork 9
65 lines (65 loc) · 2.12 KB
/
flat.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
name: data
on:
schedule:
- cron: 0 0 */2 * *
workflow_dispatch: {}
push:
paths:
- .github/workflows/flat.yml
- ./postprocessing/parse-covid-stats-data.js
- ./postprocessing/parse-mobility-data.js
- ./queries/query.sql
jobs:
scheduled:
runs-on: ubuntu-latest
steps:
- name: Setup deno
uses: denoland/setup-deno@main
with:
deno-version: v1.10.x
- name: Check out repo
uses: actions/checkout@v2
- name: Fetch data
uses: githubocto/flat@v3
with:
http_url: https://raw.githubusercontent.com/OxCGRT/USA-covid-policy/master/data/OxCGRT_US_subnational_05Aug2020.csv
downloaded_filename: ./raw-data/restrictions_per_state.csv
- name: Fetch data
uses: githubocto/flat@v2
with:
http_url: https://raw.githubusercontent.com/nytimes/covid-19-data/master/us-states.csv
downloaded_filename: ./raw-data/covid_stats.csv
postprocess: ./postprocessing/parse-covid-stats-data.js
- name: Fetch data
uses: githubocto/flat@v2
with:
sql_connstring: ${{ secrets.DB_CONNECTION_STRING }}
sql_queryfile: ./queries/query.sql
downloaded_filename: ./raw-data/mobility.csv
postprocess: ./postprocessing/parse-mobility-data.js
postprocess:
runs-on: ubuntu-latest
needs: scheduled
steps:
- name: Setup deno
uses: denoland/setup-deno@main
with:
deno-version: v1.x
- name: Checkout code
uses: actions/checkout@master
- name: Process files
run: deno run -A --unstable ./postprocessing/postprocess.js
- name: Commit & Push changes
uses: actions-js/push@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: main
force: true
- name: Build dashboard with updated data
working-directory: ./dashboard
run: yarn && yarn deploy-action
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./dashboard/out