scrape #1404
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: scrape | |
on: | |
push: | |
branches: | |
- main | |
schedule: | |
- cron: "0 4 * * *" | |
jobs: | |
scrape: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.11" | |
cache: "pip" | |
- 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@v9 | |
with: | |
add: items.json | |
author_name: "scraper" | |
author_email: "[email protected]" | |
message: "update items 📥" | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |