Skip to content

Commit

Permalink
Run with --stats once a week, refs #2
Browse files Browse the repository at this point in the history
  • Loading branch information
simonw committed Jun 8, 2022
1 parent 626c4cb commit 5577cf2
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions .github/workflows/scrape.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ on:
push:
workflow_dispatch:
schedule:
- cron: '23 * * * *'
- cron: '23 2,14 * * *' # twice a day
- cron: '38 7 * * 0' # once a week on Sunday

jobs:
scheduled:
Expand All @@ -19,7 +20,15 @@ jobs:
python-version: '3.10'
cache: 'pip'
- run: pip install -r requirements.txt
- name: Fetch latest data
- 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: |-
Expand Down

0 comments on commit 5577cf2

Please sign in to comment.