forked from nychealth/coronavirus-data
-
Notifications
You must be signed in to change notification settings - Fork 1
50 lines (42 loc) · 1.37 KB
/
fetch-upstream.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
name: Scheduled Merge and Generate CSV
on:
push:
workflow_dispatch:
schedule:
- cron: '0 0/6 * * *'
jobs:
merge-upstream:
runs-on: ubuntu-latest
steps:
- name: Check out this repo
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Fetch upstream
run: |-
git config user.name "Automated"
git config user.email "[email protected]"
git remote add upstream https://github.com/nychealth/coronavirus-data.git
git fetch upstream
git merge upstream/master
git push origin master
- name: setup python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: install python packages
run: |
python -m pip install --upgrade pip
pip install -r pressnyc/parse/requirements.txt
- name: execute pressnyc/parse/hospitalization-and-death.py
run: python pressnyc/parse/hospitalization-and-death.py
- name: execute pressnyc/parse/hospitalization-and-death-daily.py
run: python pressnyc/parse/hospitalization-and-death-daily.py
- name: Commit and push if it changed
run: |-
git config user.name "Automated"
git config user.email "[email protected]"
git add -A
timestamp=$(date -u)
git commit -m "Latest data: ${timestamp}" || exit 0
git push