-
Notifications
You must be signed in to change notification settings - Fork 4
68 lines (68 loc) · 2.22 KB
/
scrape_times.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
66
67
68
name: Scrape Times
on:
workflow_dispatch:
schedule:
- cron: '0 1 * * *'
jobs:
scrape:
if: false
name: Scrape times
runs-on: ubuntu-latest
strategy:
max-parallel: 3
matrix:
region: ['10', '20', '09', '21', '13', '23', '06', '08', '07', '25', '01', '04', '03', '17', '22', '14', '18', '05', '19', '24']
steps:
- name: Download the code
uses: actions/checkout@v2
- name: Install Python
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Install the Python dependencies
run: pip3 install -r requirements.txt
- name: Scrape the data
run: python3 scrape_times.py ${{ matrix.region }}
env:
VGR_CLIENT_ID: ${{ secrets.VGR_CLIENT_ID }}
VGR_CLIENT_SECRET: ${{ secrets.VGR_CLIENT_SECRET }}
- name: Commit the data
uses: nick-invision/retry@v2
with:
timeout_seconds: 10
max_attempts: 8
command: |
git config --global user.name 'Pierre Mesure (Github Actions)'
git config --global user.email '[email protected]'
git config --global rebase.autoStash true
git pull --rebase
git add *.json
git commit -am "Updating the times for Region ${{ matrix.region }}"
git push
generate_stats:
name: Generate the stats
runs-on: ubuntu-latest
steps:
- name: Download the code
uses: actions/checkout@v2
- name: Install Python
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Install the Python dependencies
run: pip3 install -r requirements.txt
- name: Generate the stats
run: python3 generate_stats.py
- name: Commit the data
uses: nick-invision/retry@v2
with:
timeout_seconds: 10
max_attempts: 5
command: |
git config --global user.name 'Ana Bulas Cruz (Github Actions)'
git config --global user.email '[email protected]'
git config --global rebase.autoStash true
git pull --rebase
git add data/output/stats.json
git commit -am "Updating the stats"
git push