Skip to content

Commit

Permalink
chore: EC2 Instance가 AWS Credentials를 가져오지 못하는 이슈 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
h-beeen committed Mar 12, 2024
1 parent b87cef5 commit 21998b1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .github/workflows/CD.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}

0 comments on commit 21998b1

Please sign in to comment.