Update main.yml #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 Server | |
# main 브랜치로 푸시할 때 이 워크플로우 실행 | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
# GitHub에서 리포지토리 코드를 가져오는 단계 | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
# 서버로 SSH 연결을 통한 배포 | |
- name: Deploy to server via SSH | |
uses: appleboy/ssh-action@master | |
with: | |
host: ${{ secrets.SERVER_HOST }} | |
username: ${{ secrets.SERVER_USER }} | |
key: ${{ secrets.SERVER_SSH_KEY }} | |
script: | | |
cd ./ArWebAuth/ | |
git pull origin master | |
npm install | |
pm2 restart www |