diff --git a/.github/workflows/CD.yml b/.github/workflows/CD.yml index ef54a18..416bc2c 100644 --- a/.github/workflows/CD.yml +++ b/.github/workflows/CD.yml @@ -66,7 +66,8 @@ jobs: key: ${{ secrets.EC2_PRIVATE_KEY }} port: ${{ secrets.EC2_SSH_PORT }} script: | + 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 }}