-
Notifications
You must be signed in to change notification settings - Fork 1
44 lines (36 loc) · 1.02 KB
/
scrape.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
name: scrape
on:
push:
branches:
- main
schedule:
- cron: "0 4 * * *"
jobs:
scrape:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Setup Python
uses: actions/setup-python@v1
with:
python-version: "3.8"
- name: Install Python dependencies
run: python -m pip install -r requirements.txt
# For some reason the 'overwrite' option for the Scrapy feed exporters
# doesn't work reliably for me ¯\_(ツ)_/¯
- name: Clear data file
run: rm items.json
- name: Scrape
run: scrapy crawl czech-political-parties
- name: Check that data got exported
run: "[ -s items.json ] || exit 1"
- name: Save to Git
uses: EndBug/add-and-commit@v4
with:
add: items.json
author_name: "scraper"
author_email: "[email protected]"
message: "update items 📥"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}