Skip to content

Scrape latest data #1547

Scrape latest data

Scrape latest data #1547

Workflow file for this run

name: Scrape latest data
on:
push:
workflow_dispatch:
schedule:
- cron: '23 2,14 * * *' # twice a day
- cron: '38 7 * * 0' # once a week on Sunday
jobs:
scheduled:
runs-on: ubuntu-latest
steps:
- name: Check out this repo
uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-python@v3
with:
python-version: '3.10'
cache: 'pip'
- run: pip install -r requirements.txt
- name: Fetch latest data and stats once a week OR on workflow_dispatch
if: |-
github.event_name == 'workflow_dispatch' || (
github.event_name == 'schedule' && github.event.schedule == '38 7 * * 0'
)
run: python scrape_socrata.py socrata/ --stats
- name: Fetch data without stats twice a day
if: |-
github.event_name == 'schedule' && github.event.schedule == '23 2,14 * * *'
run: python scrape_socrata.py socrata/
- name: Commit and push if it changed
run: |-
git config user.name "Automated"
git config user.email "actions@users.noreply.github.com"
git add -A
timestamp=$(date -u)
git commit -m "Latest data: ${timestamp}" || exit 0
git push