Deploy to Prod #153
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: Deploy to Prod (ECS) | |
| on: workflow_dispatch | |
| permissions: {} | |
| concurrency: | |
| group: deploy-prod | |
| cancel-in-progress: true | |
| jobs: | |
| deploy: | |
| name: Deploy | |
| runs-on: ubuntu-latest | |
| permissions: | |
| id-token: write # Needed to communicate with AWS | |
| contents: read # Needed to check out code | |
| environment: prod | |
| concurrency: prod | |
| env: | |
| ECS_CLUSTER: api | |
| ECS_SERVICE: api-prod | |
| steps: | |
| - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | |
| with: | |
| persist-credentials: false | |
| - uses: mbta/actions/build-push-ecr@788f8e264e9ebb1b76b927c89e6466d5a162be80 # v2.24 | |
| id: build-push | |
| with: | |
| role-to-assume: ${{ secrets.AWS_ROLE_ARN }} | |
| docker-repo: ${{ secrets.DOCKER_REPO }} | |
| docker-additional-tags: prod | |
| - name: Deploy to ECS | |
| uses: mbta/actions/deploy-ecs@788f8e264e9ebb1b76b927c89e6466d5a162be80 # v2.24 | |
| with: | |
| role-to-assume: ${{ secrets.AWS_ROLE_ARN }} | |
| ecs-cluster: ${{ env.ECS_CLUSTER }} | |
| ecs-service: ${{ env.ECS_SERVICE }} | |
| docker-tag: ${{ steps.build-push.outputs.docker-tag }} | |
| - uses: mbta/actions/notify-slack-deploy@788f8e264e9ebb1b76b927c89e6466d5a162be80 # v2.24 | |
| if: ${{ !cancelled() }} | |
| with: | |
| webhook-url: ${{ secrets.SLACK_WEBHOOK }} | |
| job-status: ${{ job.status }} |