From 0a874b884c4a451626beb93f4fd870fe959259f9 Mon Sep 17 00:00:00 2001 From: Haebin Date: Wed, 13 Mar 2024 02:49:12 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20EC2=20Instance=EA=B0=80=20AWS=20Credenti?= =?UTF-8?q?als=EB=A5=BC=20=EA=B0=80=EC=A0=B8=EC=98=A4=EC=A7=80=20=EB=AA=BB?= =?UTF-8?q?=ED=95=98=EB=8A=94=20=EC=9D=B4=EC=8A=88=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/CD.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/CD.yml b/.github/workflows/CD.yml index ef54a18..4e7fad8 100644 --- a/.github/workflows/CD.yml +++ b/.github/workflows/CD.yml @@ -66,7 +66,11 @@ jobs: key: ${{ secrets.EC2_PRIVATE_KEY }} port: ${{ secrets.EC2_SSH_PORT }} script: | + aws configure set aws_access_key_id ${{ secrets.AWS_ACCESS_KEY_ID }} + aws configure set aws_secret_access_key ${{ secrets.AWS_SECRET_ACCESS_KEY }} + aws configure set default.region ap-northeast-2 + aws ecr get-login-password --region ap-northeast-2 | docker login --username AWS --password-stdin ${{ secrets.ECR_URI }} docker pull ${{ secrets.ECR_URI }}:${{ steps.current-time.outputs.formattedTime }} docker ps -f name=vacgom-api -q | xargs --no-run-if-empty docker container stop docker ps -a -f name=vacgom-api -q | xargs --no-run-if-empty docker container rm - docker run -d --name vacgom-api -p 80:8080 ${{ secrets.AWS_ECR_REPO_URI }}:${{ steps.current-time.outputs.formattedTime }} + docker run -d --name vacgom-api -p 80:8080 ${{ secrets.ECR_URI }}:${{ steps.current-time.outputs.formattedTime }}