Add main.py that I forgot to include #3
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 Groceries | |
on: | |
push: | |
schedule: | |
- cron: "0 1 * * *" # Daily at 1am UTC (12pm AEST) | |
env: | |
AWS_REGION: ap-southeast-2 | |
jobs: | |
scrape-woolies: | |
permissions: | |
contents: read # Required for checkout action | |
id-token: write # This is required for requesting the JWT | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- run: pip3 install -r requirements.txt | |
- run: python3 main.py woolies | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: woolies_snapshot | |
path: ./output/woolies/*.json | |
- name: Configure AWS Credentials | |
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/ | |
scrape-coles: | |
permissions: | |
contents: read # Required for checkout action | |
id-token: write # This is required for requesting the JWT | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- run: pip3 install -r requirements.txt | |
- run: python3 main.py coles | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: coles_snapshot | |
path: ./output/coles/*.json | |
- name: Configure AWS Credentials | |
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/ |