-
Notifications
You must be signed in to change notification settings - Fork 4
232 lines (229 loc) · 7.63 KB
/
get_moh_prompt.yaml
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
name: moh-prompt
on:
# schedule:
# - cron: '10 1 * * *'
# - cron: '0 12 * * *'
# - cron: '0 17 * * *'
workflow_dispatch:
jobs:
get-moh-prompt-0:
runs-on: ubuntu-latest
steps:
- name: Check Repo
uses: actions/[email protected]
- name: Setup Python Environment
uses: actions/[email protected]
- name: Cache Python Environment
uses: actions/cache@v2
with:
path: ${{ env.pythonLocation }}
key: ${{ env.pythonLocation }}-${{ hashFiles('requirements.txt') }}
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
mkdir dataset
- name: Use 1.1.1.1 DNS
run: echo "nameserver 1.1.1.1" | sudo tee /etc/resolv.conf
# - name: Setup Chromedriver
# uses: nanasess/setup-chromedriver@master
# with:
# chromedriver-version: '92.0.4515.107'
- name: Scrape data from หมอพร้อม dashboard using selenium (total doses and by manufacturer)
working-directory: vaccine
run: python scrape_moh_prompt.py 0
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: vaccination
path: |
dataset/*.json
get-moh-prompt-1:
runs-on: ubuntu-latest
steps:
- name: Check Repo
uses: actions/[email protected]
- name: Setup Python Environment
uses: actions/[email protected]
- name: Cache Python Environment
uses: actions/cache@v2
with:
path: ${{ env.pythonLocation }}
key: ${{ env.pythonLocation }}-${{ hashFiles('requirements.txt') }}
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
mkdir dataset
- name: Use 1.1.1.1 DNS
run: echo "nameserver 1.1.1.1" | sudo tee /etc/resolv.conf
# - name: Setup Chromedriver
# uses: nanasess/setup-chromedriver@master
# with:
# chromedriver-version: '92.0.4515.107'
- name: Scrape data from หมอพร้อม dashboard using selenium
working-directory: vaccine
run: python scrape_moh_prompt.py 1
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: vaccination
path: |
dataset/*.json
get-moh-prompt-2:
runs-on: ubuntu-latest
steps:
- name: Check Repo
uses: actions/[email protected]
- name: Setup Python Environment
uses: actions/[email protected]
- name: Cache Python Environment
uses: actions/cache@v2
with:
path: ${{ env.pythonLocation }}
key: ${{ env.pythonLocation }}-${{ hashFiles('requirements.txt') }}
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
mkdir dataset
- name: Use 1.1.1.1 DNS
run: echo "nameserver 1.1.1.1" | sudo tee /etc/resolv.conf
- name: Setup Chromedriver
uses: nanasess/setup-chromedriver@master
- name: Scrape data from หมอพร้อม dashboard using selenium
working-directory: vaccine
run: python scrape_moh_prompt.py 2
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: vaccination
path: |
dataset/*.json
get-moh-prompt-3:
runs-on: ubuntu-latest
steps:
- name: Check Repo
uses: actions/[email protected]
- name: Setup Python Environment
uses: actions/[email protected]
- name: Cache Python Environment
uses: actions/cache@v2
with:
path: ${{ env.pythonLocation }}
key: ${{ env.pythonLocation }}-${{ hashFiles('requirements.txt') }}
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
mkdir dataset
- name: Use 1.1.1.1 DNS
run: echo "nameserver 1.1.1.1" | sudo tee /etc/resolv.conf
- name: Setup Chromedriver
uses: nanasess/setup-chromedriver@master
- name: Scrape data from หมอพร้อม dashboard using selenium
working-directory: vaccine
run: python scrape_moh_prompt.py 3
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: vaccination
path: |
dataset/*.json
get-moh-prompt-4:
runs-on: ubuntu-latest
steps:
- name: Check Repo
uses: actions/[email protected]
- name: Setup Python Environment
uses: actions/[email protected]
- name: Cache Python Environment
uses: actions/cache@v2
with:
path: ${{ env.pythonLocation }}
key: ${{ env.pythonLocation }}-${{ hashFiles('requirements.txt') }}
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
mkdir dataset
- name: Use 1.1.1.1 DNS
run: echo "nameserver 1.1.1.1" | sudo tee /etc/resolv.conf
- name: Setup Chromedriver
uses: nanasess/setup-chromedriver@master
- name: Scrape data from หมอพร้อม dashboard using selenium
working-directory: vaccine
run: python scrape_moh_prompt.py 4
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: vaccination
path: |
dataset/*
combine-moh-prompt:
needs:
[
get-moh-prompt-0,
get-moh-prompt-1,
get-moh-prompt-2,
get-moh-prompt-3,
get-moh-prompt-4,
]
runs-on: ubuntu-latest
steps:
- name: Check Repo
uses: actions/[email protected]
- name: Download vaccination Artifacts
uses: actions/download-artifact@v2
with:
name: vaccination
path: wiki/vaccination
- name: Setup Python Environment
uses: actions/[email protected]
- name: Cache Python Environment
uses: actions/cache@v2
with:
path: ${{ env.pythonLocation }}
key: ${{ env.pythonLocation }}-${{ hashFiles('requirements.txt') }}
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
mkdir dataset
- name: Use 1.1.1.1 DNS
run: echo "nameserver 1.1.1.1" | sudo tee /etc/resolv.conf
- name: Combined Moh Prompt Data
working-directory: vaccine
run: |
python combine_moh_prompt.py
python build_national_timeseries.py
python build_manufacturer_timeseries.py
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: vaccination-combined
path: dataset/*
commit-files-to-wiki:
needs: [combine-moh-prompt]
runs-on: ubuntu-latest
steps:
- name: Check Repo
uses: actions/[email protected]
- name: Download Vaccination Artifacts
uses: actions/download-artifact@v2
with:
name: vaccination
path: wiki/vaccination
- name: Download vaccination-combined Artifacts
uses: actions/download-artifact@v2
with:
name: vaccination-combined
path: wiki/vaccination
- name: Display structure of downloaded files
run: ls -R
- name: Upload json to wiki
uses: kai-tub/external-repo-sync-action@v1
with:
source-directory: './wiki'
env:
GH_ACCESS_TOKEN: ${{ secrets.GH_ACCESS_TOKEN }}