From 2a2a3a6aa2f7d1aa8ea63a6eba91b99c79afd5fb Mon Sep 17 00:00:00 2001 From: Jake Morrison Date: Tue, 12 Sep 2023 10:12:50 -0500 Subject: [PATCH] Add code for ECS deploy --- .github/workflows/ci.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 76db94f..3cc21a0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1212,6 +1212,18 @@ jobs: # --output text \ # --query '[deploymentId]' + # Deploy using `aws ecs update-service` + # ECR_IMAGE="${{ env.ECR_REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.VAR }}${{ env.IMAGE_VER }}" + # Get current task definition + # TASK_DEFINITION=$(aws ecs describe-task-definition --task-definition "$TASK_FAMILY" --region "$AWS_DEFAULT_REGION") + # Add new ECR image address to old template and remove unneeded attributes + # NEW_TASK_DEFINTIION=$(echo $TASK_DEFINITION | jq --arg IMAGE "$ECR_IMAGE" '.taskDefinition | .containerDefinitions[0].image = $IMAGE | del(.taskDefinitionArn) | del(.revision) | del(.status) | del(.requiresAttributes) | del(.compatibilities)') + # Register new task definition + # NEW_TASK_INFO=$(aws ecs register-task-definition --region "$AWS_DEFAULT_REGION" --cli-input-json "$NEW_TASK_DEFINTIION") + # Get new revision + # NEW_REVISION=$(echo $NEW_TASK_INFO | jq '.taskDefinition.revision') + # aws ecs update-service --cluster ${ECS_CLUSTER} --service ${SERVICE_NAME} --task-definition ${TASK_FAMILY}:${NEW_REVISION}``` + # container-test: # runs-on: ubuntu-latest # needs: [build-test]