Skip to content

Commit

Permalink
feat: re-deploy the monitor (#1954)
Browse files Browse the repository at this point in the history
* ci: push monitor post-deploy

* fixup: only run if the relevant files changed
  • Loading branch information
thecristen authored Apr 10, 2024
1 parent e54ffca commit 591c4fc
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 26 deletions.
45 changes: 19 additions & 26 deletions .github/workflows/push-monitor.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,24 @@
name: Push Monitor

on:
# UI provided by Github, values populated by repository
workflow_dispatch:
inputs:
deployment-env:
description: "Environment to deploy to"
required: true
type: environment
# Invoked via another workflow, value passed in by string
workflow_call:
inputs:
deployment-env:
description: "Environment to deploy to"
required: true
type: string

concurrency:
group: deploy-monitor-${{ inputs.deployment-env }}
cancel-in-progress: true

jobs:
push:
Expand All @@ -20,34 +37,10 @@ jobs:
docker-repo: "${{ secrets.TID_AWS_ACCOUNT_ID }}.dkr.ecr.us-east-1.amazonaws.com/dotcom-monitor"
dockerfile-path: "-f ./deploy/monitor/Dockerfile ."
role-to-assume: ${{ secrets.AWS_ROLE_ARN }}
- name: Deploy Monitor to Dev Blue
uses: mbta/actions/deploy-ecs@v2
with:
role-to-assume: ${{ secrets.AWS_ROLE_ARN }}
ecs-cluster: dotcom
ecs-service: dotcom-monitor-dev-blue
docker-tag: ${{ steps.ecr.outputs.docker-tag }}
- name: Deploy Monitor to Dev Green
uses: mbta/actions/deploy-ecs@v2
if: always()
with:
role-to-assume: ${{ secrets.AWS_ROLE_ARN }}
ecs-cluster: dotcom
ecs-service: dotcom-monitor-dev-green
docker-tag: ${{ steps.ecr.outputs.docker-tag }}
- name: Deploy Monitor to Dev
uses: mbta/actions/deploy-ecs@v2
if: always()
with:
role-to-assume: ${{ secrets.AWS_ROLE_ARN }}
ecs-cluster: dotcom
ecs-service: dotcom-monitor-dev
docker-tag: ${{ steps.ecr.outputs.docker-tag }}
- name: Deploy Monitor to Prod
- name: Deploy Monitor to ${{ inputs.deployment-env }}
uses: mbta/actions/deploy-ecs@v2
if: always()
with:
role-to-assume: ${{ secrets.AWS_ROLE_ARN }}
ecs-cluster: dotcom
ecs-service: dotcom-monitor-prod
ecs-service: dotcom-monitor-${{ inputs.deployment-env }}
docker-tag: ${{ steps.ecr.outputs.docker-tag }}
19 changes: 19 additions & 0 deletions .github/workflows/use-deploy-ecs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -164,3 +164,22 @@ jobs:
path: playwright-report
retention-days: 30

monitor:
runs-on: ubuntu-latest
needs: deploy
name: Redeploy Dotcom Monitor ${{ inputs.deployment-env }} if needed
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2
- uses: dorny/paths-filter@v3
id: changes
with:
filters: |
monitor:
- 'deploy/monitor/**'
- 'integration/**'
- uses: ./.github/workflows/push-monitor.yml
if: steps.changes.outputs.monitor == 'true'
with:
deployment-env: ${{ inputs.deployment-env }}

0 comments on commit 591c4fc

Please sign in to comment.