process-tfgm-gtfs #607
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: process-tfgm-gtfs | |
on: | |
schedule: | |
- cron: 0 0 * * * | |
workflow_dispatch: {} | |
push: | |
paths: | |
- .github/workflows/process-tfgm-gtfs.yml | |
env: | |
GIT_TERMINAL_PROMPT: 0 | |
jobs: | |
scheduled: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Install system dependencies | |
run: | | |
curl -L -o xsv.tar.gz https://github.com/BurntSushi/xsv/releases/download/0.13.0/xsv-0.13.0-x86_64-unknown-linux-musl.tar.gz | |
sudo tar xf xsv.tar.gz -C /usr/local/bin | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-node@v2 | |
with: | |
node-version: "14" | |
- run: npm install | |
# Depends on isochrone prep. Need to reogranise github actions / data flows | |
# - name: Extract stops from GTFS | |
# run: npm run regenerate-gtfs-stops | |
- name: Extract Metrolink lines from GTFS | |
run: npm run regenerate-gtfs-lines | |
- name: Verify Changed files | |
uses: tj-actions/verify-changed-files@v9 | |
id: verify-changed-files | |
with: | |
files: data/**/*.json | |
- name: Commit changes | |
if: contains(steps.verify-changed-files.outputs.changed_files, 'data/') | |
run: | | |
git config --global user.name 'Metrolink Stop (automated)' | |
git config --global user.email '[email protected]' | |
git add "${{ steps.verify-changed-files.outputs.changed_files }}" | |
git commit -m "Regenerate data from TfGM GTFS" --no-verify | |
git push |