Skip to content

Scrape AADT truck volume #39

Scrape AADT truck volume

Scrape AADT truck volume #39

name: Scrape AADT truck volume
on:
workflow_dispatch:
schedule:
- cron: '21 11 * * *'
jobs:
scheduled:
runs-on: ubuntu-latest
steps:
- name: Check out this repo
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.8
- uses: actions/cache@v2
name: Configure pip caching
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install Python dependencies
run: |-
pip install -r requirements.txt
- name: Fetch latest data
run: |-
esri2geojson https://caltrans-gis.dot.ca.gov/arcgis/rest/services/CHhighway/Truck_Volumes_AADT/FeatureServer/0 caltrans-aadt-truck-volume.json
- 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 caltrans-aadt-truck-volume.json
timestamp=$(date -u)
git commit -m "Latest data: ${timestamp}" || exit 0
git push