Add Canadian feeds (#58) #126
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
# SPDX-FileCopyrightText: 2024 Jonah Brüchert <[email protected]> | |
# SPDX-License-Identifier: CC0-1.0 | |
name: Import data | |
on: | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
jobs: | |
import: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v3 | |
- name: Fetch submodules | |
run: git submodule update --init --checkout --remote | |
- name: Build docker images | |
run: docker build -t transitous . -f ci/container/Containerfile | |
- name: Restore cached feeds | |
uses: actions/cache/restore@v4 | |
with: | |
path: | | |
downloads/ | |
out/*.zip | |
key: feeds | |
restore-keys: | | |
feeds | |
- name: Fetch GTFS-Feeds | |
run: | | |
sudo chown 1000:1000 -R out/ downloads/ | |
sudo chmod 777 . | |
docker run -v $PWD:/transitous -w /transitous transitous ci/fetch-feeds.py timer | |
docker run -v $PWD:/transitous -w /transitous transitous src/generate-attribution.py | |
- name: Import Feeds into motis | |
run: | | |
docker run -v $PWD:/transitous -w /transitous transitous src/generate-motis-config.py import | |
docker run -v $PWD:/transitous -w /transitous/out transitous ../ci/motis-import.py | |
docker run -v $PWD:/transitous -w /transitous transitous src/generate-motis-config.py full | |
- name: Cache feeds | |
uses: actions/cache/save@v4 | |
with: | |
path: | | |
downloads/ | |
out/*.zip | |
key: feeds-${{ hashFiles('downloads/*') }} | |
- name: Upload results | |
run: | | |
echo "${{secrets.RSYNC_PRIVATE_KEY}}" > deploy_key | |
chmod 600 ./deploy_key | |
rsync -avz --progress --delete \ | |
-e 'ssh -i ./deploy_key -p 22 -o StrictHostKeyChecking=no' \ | |
out/ [email protected]: | |
rm deploy_key |