-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FEAT] 깃허브 액션 CI/CD추가, OpenAI 상태 확인 API
- Loading branch information
Showing
2 changed files
with
70 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
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 | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters