Merge pull request #4 from Likelion-YeungNam-Univ/develop #4
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: Continuous Deployment | |
on: | |
push: | |
branches: ["main"] | |
jobs: | |
deploy: | |
runs-on: ubuntu-20.04 | |
steps: | |
# 1. Compare branch 코드 내려 받기 | |
- name: Checkout PR | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{ github.event.push.base_ref }} | |
# 2. SSH ACTION을 통한 Run-Command | |
- name: Deploy | |
uses: appleboy/[email protected] | |
with: | |
host: ${{ secrets.SERVER_HOST }} | |
port: ${{ secrets.SERVER_SSH_PORT }} | |
username: ${{ secrets.SERVER_USERNAME }} | |
key: ${{ secrets.SERVER_KEY }} | |
script: | | |
cd /home/ubuntu/12th-fe-actions-seminar/ | |
git pull origin main | |
npm install | |
nohup npm start & |