Update GTFS Data #35
This file contains hidden or 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: Update GTFS Data | |
| on: | |
| schedule: | |
| - cron: "0 0 * * 1" | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| jobs: | |
| update-gtfs: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Set up JDK 24 | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: temurin | |
| java-version: 24 | |
| - name: Setup Git | |
| run: | | |
| git config --global user.name 'github-actions[bot]' | |
| git config --global user.email '41898282+github-actions[bot]@users.noreply.github.com' | |
| - name: Checkout gtfs branch | |
| run: | | |
| rm -rf gtfs-branch | |
| chmod +x ./get-input.sh | |
| ./get-input.sh | |
| git clone --branch gtfs --single-branch https://github.com/${{ github.repository }}.git gtfs-branch | |
| - uses: actions/setup-go@v6 | |
| with: | |
| go-version: '^1.13.1' | |
| - name: Run Gradle task to update GTFS data | |
| run: | | |
| cd gtfs-branch | |
| chmod +x gradlew | |
| ./gradlew updateGtfs --args="../input.zip ./files/$(date +'%Y-%m-%d').zip ../cache.tsv ${{ secrets.MAPYCZ_API_KEY }}" | |
| - run: go install github.com/public-transport/gtfsclean@latest | |
| - name: Upload artifact | |
| run: | | |
| cd gtfs-branch | |
| gtfsclean -o ./files/latest.zip --fix ./files/$(date +'%Y-%m-%d').zip | |
| rm ./files/$(date +'%Y-%m-%d').zip | |
| git add -A | |
| git commit -m "📦 Update GTFS data $(date +'%Y-%m-%d')" || echo "No changes to commit" | |
| git push https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git gtfs |