fix: 배포를 위해 수정 #47
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 | |
on: | |
push: | |
branches: | |
- main | |
- deploy | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Deploy to EC2 | |
uses: appleboy/ssh-action@master | |
with: | |
host: ${{ secrets.EC2_HOST }} | |
username: ${{ secrets.EC2_USER }} | |
key: ${{ secrets.EC2_SSH_KEY }} | |
port: 22 | |
script: | | |
cd /home/ubuntu/server/RealTimeConsultingServer | |
git remote update | |
git fetch --all | |
git pull origin main | |
npm install | |
echo "${{ secrets.EC2_ENV_CONTENT }}" > .env | |
pm2 restart server || pm2 start ./src/server.js --name "server" --env-file .env |