Skip to content

Scraping new Electionline pages #52

Scraping new Electionline pages

Scraping new Electionline pages #52

Workflow file for this run

name: Scrape new ELW pages
run-name: Scraping new Electionline pages
on:
schedule:
- cron: '0 10 * * 5' # at 6am ET on Fridays
workflow_dispatch:
jobs:
Scrape-ELW:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Check out repository code
uses: actions/checkout@v4
- name: Setup Python environment
uses: actions/setup-python@v5
with:
python-version: '3.11.7'
- name: Install required packages
run: |
python -m pip install --upgrade pip
pip install -r elw_scraper/requirements.txt
- name: Write secret to file
run: |
cat << EOF > ./gspread_credentials.json
${{ secrets.GSPREAD_SERVICE_ACCOUNT }}
EOF
- name: Download new pages
run: python elw_scraper/add_new_pages.py
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
- name: Commit and push changes
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: Scrape new pages