Skip to content

Deploy

Deploy #642

Workflow file for this run

name: Deploy
on:
workflow_run:
workflows: ["CI"]
types: [completed]
branches: [main]
workflow_dispatch:
inputs:
env:
default: "dev"
description: "Environment"
required: true
type: environment
jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
if: >-
${{
github.event_name == 'workflow_dispatch' ||
github.event.workflow_run.conclusion == 'success'
}}
environment: ${{ github.event.inputs.env || 'dev' }}
concurrency: ${{ github.event.inputs.env || 'dev' }}
env:
TARGET: ${{ github.event.inputs.env || 'dev' }}
steps:
- uses: actions/checkout@v2
- uses: mbta/actions/build-push-ecr@v2
id: build-push
with:
role-to-assume: ${{ secrets.AWS_ROLE_ARN }}
docker-repo: ${{ secrets.DOCKER_REPO }}
- uses: mbta/actions/deploy-ecs@v2
with:
role-to-assume: ${{ secrets.AWS_ROLE_ARN }}
ecs-cluster: alerts-concierge
ecs-service: alerts-concierge-${{ env.TARGET }}
docker-tag: ${{ steps.build-push.outputs.docker-tag }}
- uses: mbta/actions/notify-slack-deploy@v1
if: ${{ !cancelled() }}
with:
webhook-url: ${{ secrets.SLACK_WEBHOOK }}
job-status: ${{ job.status }}