Skip to content

Commit

Permalink
Move push workflow into separate quick jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
Javex committed Sep 27, 2023
1 parent 68dc306 commit 89850ec
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 6 deletions.
8 changes: 2 additions & 6 deletions .github/workflows/scrape-groceries.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Scrape Groceries
on:
push:
workflow_dispatch:
schedule:
- cron: "0 1 * * *" # Daily at 1am UTC (12pm AEST)
env:
Expand All @@ -20,13 +20,11 @@ jobs:
name: woolies_snapshot
path: ./output/woolies/
- name: Configure AWS Credentials
if: ${{ github.event_name == 'schedule' }}
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: "${{ vars.TARGET_ROLE_ARN }}"
aws-region: ap-southeast-2
- run: aws s3 sync ./output/woolies/ s3://grocery-scrape-au/woolies/
if: ${{ github.event_name == 'schedule' }}
scrape-coles:
permissions:
contents: read # Required for checkout action
Expand All @@ -41,10 +39,8 @@ jobs:
name: coles_snapshot
path: ./output/coles/
- name: Configure AWS Credentials
if: ${{ github.event_name == 'schedule' }}
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: "${{ vars.TARGET_ROLE_ARN }}"
aws-region: ap-southeast-2
- run: aws s3 sync ./output/coles/ s3://grocery-scrape-au/coles/
if: ${{ github.event_name == 'schedule' }}
- run: aws s3 sync ./output/coles/ s3://grocery-scrape-au/coles/
24 changes: 24 additions & 0 deletions .github/workflows/scrape-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Quick scrape test
on:
push:
jobs:
scrape-woolies:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: pip3 install -r requirements.txt
- run: python3 main.py --quick woolies
- uses: actions/upload-artifact@v3
with:
name: woolies_snapshot
path: ./output/woolies/
scrape-coles:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: pip3 install -r requirements.txt
- run: python3 main.py --quick coles
- uses: actions/upload-artifact@v3
with:
name: coles_snapshot
path: ./output/coles/

0 comments on commit 89850ec

Please sign in to comment.