Skip to content

Commit 2b4289d

Browse files
committed
#45 fix: 프론트엔드 CI/CD docker 설정 수정
1 parent b5958f3 commit 2b4289d

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

.github/workflows/frontend.yml

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff 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()

0 commit comments

Comments
 (0)