-
Notifications
You must be signed in to change notification settings - Fork 1
40 lines (31 loc) · 1009 Bytes
/
scraper.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
name: Corona-Dashboard-Scraper
on:
push:
schedule:
- cron: '6 8,9,10,11,17 * * *'
jobs:
scrape-data:
name: Scrape, commit and push
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v2
- name: Install dependencies
shell: bash
run: |
sudo gem install bundler -v "$(grep -A 1 "BUNDLED WITH" Gemfile.lock | tail -n 1)"
sudo gem update bundler
bundle install
- name: Run Scraper
shell: bash
run: |
make data
- name: Commit and push if it changed
shell: bash
run: |-
git config user.name "Automated"
git config user.email "[email protected]"
timestamp=$(date "+%Y-%m-%d")
# the commands after the || only run if git diff detects any changes
git diff --quiet || make README.md && git add README.md data/target && git commit -m "add ${timestamp}" && true
git push