Add action to deploy to ECS after image is built
CI / build (push) Has been cancelled

This commit is contained in:
Dustin Pianalto
2020-10-11 22:23:05 -08:00
parent cadef92efb
commit 13f80a6972
2 changed files with 152 additions and 0 deletions
+18
View File
@@ -33,6 +33,7 @@ jobs:
uses: battila7/get-version-action@v2.0.0
- name: Build, tag, and push image to Amazon ECR
id: build-image
env:
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
ECR_REPOSITORY: goff
@@ -42,3 +43,20 @@ jobs:
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
docker tag $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG $ECR_REGISTRY/$ECR_REPOSITORY:latest
docker push $ECR_REGISTRY/$ECR_REPOSITORY:latest
echo "::set-output name=image::$ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG"
- name: Fill in the new image ID in the Amazon ECS task definition
id: task-def
uses: aws-actions/amazon-ecs-render-task-definition@v1
with:
task-definition: task-definition.json
container-name: "goff"
image: ${{ steps.build-image.outputs.image }}
- name: Deploy Amazon ECS task definition
uses: aws-actions/amazon-ecs-deploy-task-definition@v1
with:
task-definition: ${{ steps.task-def.outputs.task-definition }}
service: "goff"
cluster: "discord-bots"
wait-for-service-stability: true