diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index f733a803..f09c3ce0 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -40,4 +40,21 @@ jobs: run: | docker build -t be-repo . docker tag be-repo 224066583965.dkr.ecr.ap-northeast-2.amazonaws.com/be-repo - docker push 224066583965.dkr.ecr.ap-northeast-2.amazonaws.com/be-repo \ No newline at end of file + docker push 224066583965.dkr.ecr.ap-northeast-2.amazonaws.com/be-repo + echo "::set-output name=image::224066583965.dkr.ecr.ap-northeast-2.amazonaws.com/be-repo" + ## ECS task 정의 + - name: Push the image ID in the ECS task definition + id: task-def + uses: aws-actions/amazon-ecr-render-task-definition@v1 + with: + task-definition: task-definition.json + container-name: be-container + image: ${{ steps.build-image.outputs.image }} + ## ECS 실행 + - name: Deploy ECS task definition + uses: aws-actions/amazon-ecr-render-task-definition@v1 + with: + task-definition: ${{ steps.task-def.outputs.task-definition }} + service: sroom-service + cluster: sroom + wait-for-service-stability: true diff --git a/task-definition.json b/task-definition.json index e3a031a3..4a992204 100644 --- a/task-definition.json +++ b/task-definition.json @@ -37,7 +37,7 @@ "memoryReservation": 500, "volumesFrom": [], "stopTimeout": null, - "image": "224066583965.dkr.ecr.ap-northeast-2.amazonaws.com/sroom-repo:2023-09-16T18-52-43", + "image": "224066583965.dkr.ecr.ap-northeast-2.amazonaws.com/be-repo:latest", "startTimeout": null, "firelensConfiguration": null, "dependsOn": null, @@ -64,7 +64,7 @@ "EXTERNAL", "EC2" ], - "taskDefinitionArn": "arn:aws:ecs:ap-northeast-2:224066583965:task-definition/be-task:2", + "taskDefinitionArn": "arn:aws:ecs:ap-northeast-2:224066583965:task-definition/be-task:3", "family": "be-task", "requiresAttributes": [ { @@ -117,7 +117,7 @@ "networkMode": "bridge", "runtimePlatform": null, "cpu": null, - "revision": 2, + "revision": 3, "status": "ACTIVE", "inferenceAccelerators": null, "proxyConfiguration": null,