-
Notifications
You must be signed in to change notification settings - Fork 7
60 lines (48 loc) · 1.55 KB
/
update-stats.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
name: Update stats
on:
workflow_dispatch:
schedule:
# Runs every 3 hours (see https://crontab.guru)
- cron: "0 */3 * * *"
jobs:
update-stats:
name: Update stats
runs-on: ubuntu-latest
environment: stats
steps:
- name: Checkout repo
uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: 3.9
- uses: actions/cache@v3
name: Configure pip caching
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install dependencies
run: pip install -r requirements.txt
- name: Get installed Playwright version
id: playwright-version
run: echo "PLAYWRIGHT_VERSION=1.40.0" >> $GITHUB_ENV
- name: Cache playwright binaries
uses: actions/cache@v3
id: playwright-cache
with:
path: |
~/.cache/ms-playwright
key: ${{ runner.os }}-playwright-${{ env.PLAYWRIGHT_VERSION }}
- run: pip install playwright==${{ env.PLAYWRIGHT_VERSION }}
if: steps.playwright-cache.outputs.cache-hit != 'true'
- run: python -m playwright install
- name: Scrape new data values
run: ./scrape.py
- uses: EndBug/add-and-commit@v9 # You can change this to use a specific version.
with:
add: "."
author_name: "GitHub Actions"
message: "Scrape and update stats"
push: true