Skip to content

Commit

Permalink
fix: consolidate into one job
Browse files Browse the repository at this point in the history
  • Loading branch information
thecristen committed Mar 1, 2024
1 parent 3c3d586 commit a7c3601
Showing 1 changed file with 28 additions and 13 deletions.
41 changes: 28 additions & 13 deletions .github/workflows/push-monitor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ jobs:
permissions:
id-token: write
contents: read
outputs:
docker-tag: ${{ steps.ecr.outputs.docker-tag }}
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -22,17 +20,34 @@ 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 }}
deploy:
name: Deploy monitor to all environments
runs-on: ubuntu-latest
strategy:
matrix:
deploy-env: [dev-green, dev-blue, dev, prod]
needs: [push]
steps:
- uses: mbta/actions/deploy-ecs@v2
- 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
uses: mbta/actions/deploy-ecs@v2
if: always()
with:
role-to-assume: ${{ secrets.AWS_ROLE_ARN }}
ecs-cluster: dotcom
ecs-service: dotcom-monitor-${{ matrix.deploy-env }}
docker-tag: needs.push.outputs.docker-tag
ecs-service: dotcom-monitor-prod
docker-tag: steps.ecr.outputs.docker-tag

0 comments on commit a7c3601

Please sign in to comment.