Skip to content

Commit 41d7e60

Browse files
committed
test: live server 배포를 위해 임시 배포 코드 추가
1 parent ce133a1 commit 41d7e60

1 file changed

Lines changed: 29 additions & 0 deletions

File tree

.github/workflows/ci_cd.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,35 @@ jobs:
9797
chmod +x /home/ubuntu/app/deploy.sh
9898
/home/ubuntu/app/deploy.sh ${{ env.IMAGE_TAG }} canary
9999
100+
- name: Ensure app directory exists on LIVE EC2
101+
uses: appleboy/ssh-action@master
102+
with:
103+
host: ${{ secrets.AWS_LIVE_EC2_HOST }}
104+
username: ubuntu
105+
key: ${{ secrets.AWS_EC2_SSH_KEY }}
106+
script: |
107+
mkdir -p /home/ubuntu/app
108+
chmod -R 755 /home/ubuntu/app
109+
110+
- name: Upload files to LIVE EC2
111+
uses: appleboy/scp-action@master
112+
with:
113+
host: ${{ secrets.AWS_LIVE_EC2_HOST }}
114+
username: ubuntu
115+
key: ${{ secrets.AWS_EC2_SSH_KEY }}
116+
source: "docker-compose.yml,deploy.sh"
117+
target: "/home/ubuntu/app/"
118+
119+
- name: Deploy to LIVE EC2
120+
uses: appleboy/ssh-action@master
121+
with:
122+
host: ${{ secrets.AWS_LIVE_EC2_HOST }}
123+
username: ubuntu
124+
key: ${{ secrets.AWS_EC2_SSH_KEY }}
125+
script: |
126+
chmod +x /home/ubuntu/app/deploy.sh
127+
/home/ubuntu/app/deploy.sh ${{ env.IMAGE_TAG }} live
128+
100129
- name: Register Canary EC2 to ALB
101130
run: |
102131
aws elbv2 register-targets \

0 commit comments

Comments
 (0)