From 5577cf20b43534caa6354158d6f28e78a6b66e80 Mon Sep 17 00:00:00 2001 From: Simon Willison Date: Tue, 7 Jun 2022 17:01:32 -0700 Subject: [PATCH] Run with --stats once a week, refs #2 --- .github/workflows/scrape.yml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/scrape.yml b/.github/workflows/scrape.yml index 6ba3ba99a5..148e4ba0ef 100644 --- a/.github/workflows/scrape.yml +++ b/.github/workflows/scrape.yml @@ -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: @@ -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: |-