Skip to content

Scrape latest data #916

Scrape latest data

Scrape latest data #916

Workflow file for this run

name: Scrape latest data
on:
push:
push:
schedule:
- cron: "0 12 * * *"
workflow_dispatch:
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
jobs:
scheduled:
runs-on: ubuntu-latest
steps:
-
name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
-
name: "Check out this repo"
uses: actions/checkout@v3
- name: Install dependencies
run: |
python -m pip install --upgrade pip
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: scrape legislature reports
working-directory: .
run: |
cd wv-legislature && python agency_reports.py
- name: scrape crime log
working-directory: .
run: |
cd crime-log && python crime_log.py
- name: scrape meetings
working-directory: .
run: |
cd meeting-notices && python scraper.py
- name: scrape lobbying
working-directory: .
run: |
cd lobbying && python lobbying_filings.py 2023-2024
-
name: "Commit and push if it changed"
run: |-
git config user.name "Automated"
git config user.email "actions@users.noreply.github.com"
git pull
git add -A
timestamp=$(date -u)
git commit -m "Latest data: ${timestamp}" || exit 0
git push
- name: "build Datasette"
run: |-
rm wvu.db
sqlite-utils insert wvu.db crimelog crime-log/crime_log.csv --csv
- name: Fly setup
uses: superfly/flyctl-actions/setup-flyctl@master
- name: deploy
run: datasette publish fly wvu.db --app wvu-crime-log