Skip to content

Commit

Permalink
wip: use AWS actions to deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
bklebe committed Jul 2, 2024
1 parent 0273b4b commit ec57353
Showing 1 changed file with 20 additions and 6 deletions.
26 changes: 20 additions & 6 deletions .github/workflows/use-deploy-ecs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ on:
docker-repo:
required: true
description: "The Docker repository to upload the docker image to, formatted '....amazonaws.com/<app>'"
outputs:
outputs:
deployment-env:
value: ${{ jobs.deploy.outputs.deployment-env }}
description: "The environment that was deployed to"
Expand Down Expand Up @@ -94,12 +94,26 @@ jobs:
cache-from: type=gha,src=/tmp/.buildx-cache
cache-to: type=gha,dest=/tmp/.buildx-cache,mode=max

- uses: mbta/actions/deploy-ecs@v2
- name: Download task definition
run: |
aws ecs describe-task-definition --task-definition dotcom-${{ inputs.deployment-env }} --query taskDefinition > task-definition.json
- name: Render Amazon ECS task definition
id: render-web-container
uses: aws-actions/amazon-ecs-render-task-definition@v1
with:
role-to-assume: ${{ secrets.aws-role-arn }}
ecs-cluster: dotcom
ecs-service: dotcom-${{ inputs.deployment-env }}
docker-tag: ${{ fromJSON(steps.meta.outputs.json).tags[0] }}
task-definition: task-definition.json
container-name: dotcom
image: ${{ fromJSON(steps.meta.outputs.json).tags[0] }}

- name: Deploy to Amazon ECS service
uses: aws-actions/amazon-ecs-deploy-task-definition@v1
with:
task-definition: ${{ steps.render-web-container.outputs.task-definition }}
service: dotcom-${{ inputs.deployment-env }}
cluster: dotcom
wait-for-service-stability: true

smoke:
runs-on: ubuntu-latest
needs: deploy
Expand Down

0 comments on commit ec57353

Please sign in to comment.