Skip to content

Deploy Feeds API - DEV #324

Deploy Feeds API - DEV

Deploy Feeds API - DEV #324

Workflow file for this run

# Deploys the feeds API to MobilityData DEV environment
name: Deploy Feeds API - DEV
on:
workflow_dispatch: # Supports manual deployment
inputs:
run_integration_tests:
description: 'true to run the integration tests'
required: false
default: 'false'
jobs:
api-build-deployment:
uses: ./.github/workflows/api-deployer.yml
with:
ENVIRONMENT: ${{ vars.DEV_MOBILITY_FEEDS_ENVIRONMENT }}
BUCKET_NAME: ${{ vars.DEV_MOBILITY_FEEDS_TF_STATE_BUCKET }}
OBJECT_PREFIX: ${{ vars.DEV_MOBILITY_FEEDS_TF_STATE_OBJECT_PREFIX }}
PROJECT_ID: ${{ vars.DEV_MOBILITY_FEEDS_PROJECT_ID }}
REGION: ${{ vars.MOBILITY_FEEDS_REGION }}
DEPLOYER_SERVICE_ACCOUNT: ${{ vars.DEV_MOBILITY_FEEDS_DEPLOYER_SERVICE_ACCOUNT }}
FEED_API_IMAGE_VERSION: ${{ github.sha }}
GLOBAL_RATE_LIMIT_REQ_PER_MINUTE: ${{ vars.GLOBAL_RATE_LIMIT_REQ_PER_MINUTE }}
TF_APPLY: true
VALIDATOR_ENDPOINT: https://stg-gtfs-validator-web-mbzoxaljzq-ue.a.run.app
OPERATIONS_OAUTH2_CLIENT_ID_1PASSWORD: "op://rbiv7rvkkrsdlpcrz3bmv7nmcu/GCP_FEEDS_API_TOKEN_OAUTH2_DEV/username"
secrets:
GCP_MOBILITY_FEEDS_SA_KEY: ${{ secrets.DEV_GCP_MOBILITY_FEEDS_SA_KEY }}
OAUTH2_CLIENT_ID: ${{ secrets.DEV_MOBILITY_FEEDS_OAUTH2_CLIENT_ID}}
OAUTH2_CLIENT_SECRET: ${{ secrets.DEV_MOBILITY_FEEDS_OAUTH2_CLIENT_SECRET}}
OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
integration-tests:
if: ${{ github.event.inputs.run_integration_tests == 'true' }}
uses: ./.github/workflows/integration-tests.yml
needs:
- api-build-deployment
with:
API_URL: 'https://api-dev.mobilitydatabase.org'
ENVIRONMENT: 'dev'
secrets:
REFRESH_TOKEN: ${{ secrets.DEV_API_TEST_REFRESH_TOKEN }}
notify-slack-on-failure:
needs: [ api-build-deployment, integration-tests ]
if: always() && (needs.api-build-deployment.result == 'failure' || needs.integration-tests.result == 'failure')
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Notify Slack
uses: ./.github/actions/notify-slack
with:
OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}