File tree Expand file tree Collapse file tree 1 file changed +14
-4
lines changed
Expand file tree Collapse file tree 1 file changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -57,10 +57,20 @@ jobs:
5757
5858 echo "Logging into ECR and pulling image..."
5959 aws ecr get-login-password --region ap-northeast-2 | docker login --username AWS --password-stdin ${{ secrets.AWS_ECR_FRONTEND_REPOSITORY }}
60-
61- echo "Deploying frontend container..."
62- docker compose pull frontend
63- docker compose up -d --no-deps frontend
60+
61+ echo "PULLING LATEST IMAGE..."
62+ docker pull ${{ secrets.AWS_ECR_FRONTEND_REPOSITORY }}:latest
63+
64+ echo "STOPPING AND REMOVING EXISTING CONTAINERS..."
65+ sudo docker compose down --remove-orphans || true
66+
67+ echo "REMOVING UNUSED DOCKER IMAGES..."
68+ docker image rm ${{ secrets.AWS_ECR_FRONTEND_REPOSITORY }}:latest || true
69+
70+ echo "STARTING NEW CONTAINER..."
71+ sudo docker compose up -d --force-recreate
72+
73+ echo "✅ DEPLOYMENT COMPLETE!"
6474
6575 - name : Remove GitHub Actions IP from EC2 security group
6676 if : always()
You can’t perform that action at this time.
0 commit comments