Skip to content

Commit d230c3c

Browse files
authored
update : depoly.yml 배포 추가
1 parent 3248789 commit d230c3c

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

.github/workflows/deploy.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,3 +51,19 @@ jobs:
5151
target: '/home/ubuntu/'
5252
strip_components: 1
5353

54+
- name: Extract and Deploy on EC2
55+
uses: appleboy/ssh-action@master
56+
with:
57+
host: ${{ secrets.EC2_HOST }}
58+
username: ${{ secrets.EC2_USERNAME }}
59+
key: ${{ secrets.EC2_SSH_PRIVATE_KEY }}
60+
script: |
61+
cd /home/ubuntu/
62+
tar -xzf build.tar.gz
63+
sudo rm -rf /etc/nginx/html/*
64+
sudo mv dist/* /etc/nginx/html/
65+
cd /etc/nginx/html
66+
pm2 restart to-hero
67+
sudo docker exec nginx nginx -s reload
68+
rm -f /home/ubuntu/build.tar.gz
69+

0 commit comments

Comments
 (0)