-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (38 loc) · 1.07 KB
/
deploy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
name: Deploy to EC2
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Deploy to EC2 via SSH
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.EC2_HOST }}
username: ${{ secrets.EC2_USER }}
key: ${{ secrets.EC2_SSH_KEY }}
script: |
cd /home/ec2-user/Starting_Block_PDFGPT
git pull origin main
sudo reboot
verify:
needs: deploy
runs-on: ubuntu-latest
steps:
- name: Wait for EC2 to reboot
run: sleep 90 # 90초(1분30초) 정도 기다렸다가 서버가 부팅 완료될 시간을 줌
- name: Check server status
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.EC2_HOST }}
username: ${{ secrets.EC2_USER }}
key: ${{ secrets.EC2_SSH_KEY }}
script: |
sudo systemctl status starting_block_pdfgpt.service
- name: Check API Documentation
run: |
curl -I https://pdfgpt.startingblock.co.kr/docs