[DOCS] ReadMe Convention 추가 #2
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
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 | |