diff --git a/.github/workflows/ecr.yml b/.github/workflows/ecr.yml index 0813bc2..01abc89 100644 --- a/.github/workflows/ecr.yml +++ b/.github/workflows/ecr.yml @@ -101,21 +101,12 @@ jobs: branch="${{ github.ref_name }}" sha="${{ github.sha }}" - # ECS 배포는 EC2 -> ECS 전환 단계에서 다시 활성화한다. - # resp=$(curl -s -o /tmp/resp.txt -w "%{http_code}" -X POST \ - # "https://api.github.com/repos/${{ github.repository }}/dispatches" \ - # -H "Accept: application/vnd.github+json" \ - # -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \ - # -d "{\"event_type\":\"deploy-ecs\",\"client_payload\":{\"image_uri\":\"$image_uri\",\"tag\":\"$tag\",\"branch\":\"$branch\",\"sha\":\"$sha\"}}") - # [ "$resp" = "204" ] || (echo "ECS dispatch failed:" && cat /tmp/resp.txt && exit 1) - - # EC2 - resp2=$(curl -s -o /tmp/resp2.txt -w "%{http_code}" -X POST \ + resp=$(curl -s -o /tmp/resp.txt -w "%{http_code}" -X POST \ "https://api.github.com/repos/${{ github.repository }}/dispatches" \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \ - -d "{\"event_type\":\"deploy-ec2\",\"client_payload\":{\"image_uri\":\"$image_uri\",\"tag\":\"$tag\",\"branch\":\"$branch\",\"sha\":\"$sha\"}}") - [ "$resp2" = "204" ] || (echo "EC2 dispatch failed:" && cat /tmp/resp2.txt && exit 1) + -d "{\"event_type\":\"deploy-ecs\",\"client_payload\":{\"image_uri\":\"$image_uri\",\"tag\":\"$tag\",\"branch\":\"$branch\",\"sha\":\"$sha\"}}") + [ "$resp" = "204" ] || (echo "ECS dispatch failed:" && cat /tmp/resp.txt && exit 1) - name: Summary run: | @@ -124,5 +115,4 @@ jobs: echo "- Tag: \`${{ steps.tag.outputs.TAG }}\`" >> $GITHUB_STEP_SUMMARY echo "- Image: \`${{ steps.build.outputs.IMAGE_URI }}\`" >> $GITHUB_STEP_SUMMARY echo "- Arch: \`linux/arm64\`" >> $GITHUB_STEP_SUMMARY - # echo "- Sent: \`repository_dispatch: deploy-ecs\`" >> $GITHUB_STEP_SUMMARY - echo "- Sent: \`repository_dispatch: deploy-ec2\`" >> $GITHUB_STEP_SUMMARY + echo "- Sent: \`repository_dispatch: deploy-ecs\`" >> $GITHUB_STEP_SUMMARY diff --git a/.github/workflows/ecs.yml b/.github/workflows/ecs.yml index 5742ea4..ad3b850 100644 --- a/.github/workflows/ecs.yml +++ b/.github/workflows/ecs.yml @@ -16,9 +16,9 @@ env: AWS_REGION: ap-northeast-2 ECR_REPOSITORY: kickytime-repo ECS_CLUSTER: kickytime-cluster - ECS_SERVICE: kickytime-task-service + ECS_SERVICE: kickytime-service TASK_FAMILY: kickytime-task - CONTAINER_NAME: kickytime-ecr + CONTAINER_NAME: kickytime jobs: deploy: @@ -85,7 +85,7 @@ jobs: --output text) echo "TASK_DEF_ARN=$NEW_TD_ARN" >> $GITHUB_OUTPUT - - name: Update service (rolling deployment) + - name: Update service (ECS blue/green deployment) if: steps.gate.outputs.GO == 'true' run: | aws ecs update-service \