Backend #48
Workflow file for this run
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: GCP CI/CD | |
on: | |
pull_request: | |
types: | |
- closed | |
jobs: | |
if_merged: | |
if: github.event.pull_request.merged == true | |
runs-on: ubuntu-latest | |
steps: | |
- uses: appleboy/ssh-action@master | |
with: | |
host: ${{ secrets.HOST }} | |
username: ${{ secrets.USERNAME }} | |
key: ${{ secrets.SSH_KEY }} | |
#passphrase: ${{ secrets.PASSPHRASE }} | |
port: 22 | |
- name: npm install | |
run: | | |
pwd | |
cd ${{ secrets.PWD }} | |
git pull origin main | |
# Frontend Merge 시 React 빌드 | |
- name: React build | |
if: github.head_ref == 'Frontend' | |
run: | | |
cd ${{ secrets.PWD }}/Backend/Frontend/creative | |
pm2 stop Traffic | |
npm install | |
npm run build | |
# Merge 하는 경우 서버 재시작 | |
- name: server restart | |
run: | | |
cd ${{ secrets.PWD }}/BackendJS/BackendTS | |
npm install | |
pm2 restart Traffic |