Skip to content

Commit 257d0b3

Browse files
committed
deploy : 80 포트로 수정
1 parent 76ee760 commit 257d0b3

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

.github/workflows/deploy.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,27 @@ jobs:
4646
run: |
4747
docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG .
4848
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
49+
50+
# Create deploy.sh
4951
mkdir scripts
5052
touch scripts/deploy.sh
53+
echo "#!/bin/bash" > scripts/deploy.sh
54+
55+
# Login to ECR
5156
echo "aws ecr get-login-password --region ap-northeast-2 | docker login --username AWS --password-stdin $ECR_REGISTRY" >> scripts/deploy.sh
57+
58+
# Check and remove existing container
59+
echo "EXISTING_CONTAINER=\$(docker ps -q -f name=chalkac)" >> scripts/deploy.sh
60+
echo "if [ -n \"\$EXISTING_CONTAINER\" ]; then" >> scripts/deploy.sh
61+
echo " echo \"Stopping and removing existing container...\"" >> scripts/deploy.sh
62+
echo " docker stop chalkac" >> scripts/deploy.sh
63+
echo " docker rm chalkac" >> scripts/deploy.sh
64+
echo "fi" >> scripts/deploy.sh
65+
66+
# Pull latest image
5267
echo "docker pull $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG" >> scripts/deploy.sh
68+
69+
# Run new container
5370
echo "docker run -p 80:80 -e PROFILE=dev -d --restart always --name chalkac $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG" >> scripts/deploy.sh
5471
5572
- name: upload to s3

0 commit comments

Comments
 (0)