2023-09-01 10:13:44 -07:00
|
|
|
|
2023-09-01 10:00:03 -07:00
|
|
|
name: Run Snowscraper and Commit Changes
|
|
|
|
|
|
|
|
on:
|
|
|
|
schedule:
|
|
|
|
- cron: '0 0 * * *' # Run daily at midnight
|
|
|
|
workflow_dispatch: # Allow manual trigger
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
scrape-and-commit:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout Repository
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
|
|
|
|
- name: Set up Python
|
|
|
|
uses: actions/setup-python@v2
|
|
|
|
with:
|
|
|
|
python-version: 3.8
|
|
|
|
|
|
|
|
- name: Install Dependencies
|
|
|
|
run: |
|
|
|
|
python -m pip install --upgrade pip
|
|
|
|
pip install -r requirements.txt
|
|
|
|
|
|
|
|
- name: Run Scraper
|
|
|
|
run: python -m snowscraper.cli
|
|
|
|
|
|
|
|
- name: Commit and Push Changes
|
|
|
|
run: |
|
|
|
|
git config --local user.email "action@github.com"
|
|
|
|
git config --local user.name "GitHub Action"
|
|
|
|
git add -A
|
|
|
|
git commit -m "Update scraped data" || echo "No changes to commit"
|
|
|
|
git push
|