-
Notifications
You must be signed in to change notification settings - Fork 18
46 lines (41 loc) · 1.29 KB
/
update_json.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
name: Update JSON
on:
schedule:
- cron: "0 * * * *"
workflow_dispatch:
jobs:
update:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
token: ${{ secrets.GIT_ACCESS_TOKEN }}
- name: Cache dependencies
uses: actions/cache@v3
with:
path: .venv
key: ${{ runner.os }}-pip-${{ hashFiles('scraper/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Setup Python
run: |
python3 -m venv .venv
source .venv/bin/activate
pip install -r scraper/requirements.txt
- name: Create local changes
run: |
source .venv/bin/activate
python scraper/src/meta.py
python scraper/src/pmu.py
python scraper/src/donors.py
python scraper/src/hospitals.py
python scraper/src/associate.py
python scraper/src/status.py
- name: Commit files
run: |
git config --local user.email "[email protected]"
git config --local user.name "github-actions[bot]"
git add .
git diff --staged --quiet || git commit -am "🌍 Update JSON - $(date -d '+5 hours +30 minutes' +'%d %b %Y | %I:%M %p')"
git push