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: Generate SVG from GTFS | |
run-name: ${{ inputs.transit_agency }} | |
on: | |
workflow_dispatch: | |
inputs: | |
transit_agency: | |
type: string | |
description: Name of transit agency | |
gtfs_source: | |
type: string | |
description: URL to GTFS zip file | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: '3.10' | |
- name: Install requirements | |
run: | | |
pip install -r requirements.txt | |
- name: Fetch CDTA GTFS | |
run: | | |
wget ${{ inputs.gtfs_source }} | |
unzip *.zip -d gtfs | |
- name: Convert to GeoJSON | |
run: | | |
python generate_route_shapes.py -i gtfs -o geojson | |
- name: Convert to SVG | |
run: | | |
python geojson_to_svg.py -i geojson -o ${{ inputs.transit_agency }}.svg | |
- name: Commit file | |
run: | | |
git config user.name "GTFS to SVG" | |
git config user.email "[email protected]" | |
git add ${{ inputs.transit_agency }}.svg | |
git commit -m "$(date)" || exit 0 | |
git push |