Skip to content

add support for reprocessing gtfs data #121

add support for reprocessing gtfs data

add support for reprocessing gtfs data #121

Workflow file for this run

name: Python package
on: [push, pull_request]
jobs:
deploy:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: deploy
if: ${{ github.event_name == 'push' }}
env:
DOCKER_APP_IMAGE_NAME: "ghcr.io/hasadna/open-bus-gtfs-etl/open-bus-gtfs-etl"
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
OPEN_BUS_PIPELINES_DEPLOY_KEY: ${{ secrets.OPEN_BUS_PIPELINES_DEPLOY_KEY }}
run: |
echo "${GITHUB_TOKEN}" | docker login ghcr.io -u hasadna --password-stdin &&\
if docker pull "${DOCKER_APP_IMAGE_NAME}:latest"; then
CACHE_FROM_ARG="--cache-from ${DOCKER_APP_IMAGE_NAME}:latest"
else
CACHE_FROM_ARG=""
fi &&\
docker build $CACHE_FROM_ARG -t app . &&\
docker tag app "${DOCKER_APP_IMAGE_NAME}:${GITHUB_SHA}" &&\
docker push "${DOCKER_APP_IMAGE_NAME}:${GITHUB_SHA}" &&\
git config --global user.name "Open Bus GTFS ETL CI" &&\
git config --global user.email "open-bus-gtfs-etl-ci@localhost" &&\
OPEN_BUS_GTFS_ETL_ROOTDIR="$(pwd)" &&\
if [ "${GITHUB_REF}" == "refs/heads/main" ]; then
docker tag app "${DOCKER_APP_IMAGE_NAME}:latest" &&\
docker push "${DOCKER_APP_IMAGE_NAME}:latest" &&\
if ! git log -1 --pretty=format:"%s" | grep -- --no-deploy; then
cd `mktemp -d` &&\
echo "${OPEN_BUS_PIPELINES_DEPLOY_KEY}" > open_bus_pipelines_deploy_key &&\
chmod 400 open_bus_pipelines_deploy_key &&\
export GIT_SSH_COMMAND="ssh -i `pwd`/open_bus_pipelines_deploy_key -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no" &&\
git clone git@github.com:hasadna/open-bus-pipelines.git &&\
cd open-bus-pipelines &&\
echo "-r https://github.com/hasadna/open-bus-gtfs-etl/raw/${GITHUB_SHA}/requirements.txt" > requirements-gtfs-etl.txt &&\
echo "https://github.com/hasadna/open-bus-gtfs-etl/archive/${GITHUB_SHA}.zip" >> requirements-gtfs-etl.txt &&\
git add requirements-gtfs-etl.txt &&\
git commit -m "automatic update of gtfs etl requirements" &&\
git push origin main
fi
fi