Skip to content

Commit

Permalink
Feat: CI/CD PR 분기점 분류 적용
Browse files Browse the repository at this point in the history
  • Loading branch information
sw0501 committed Oct 20, 2023
1 parent 3f86ec4 commit 85f6752
Showing 1 changed file with 32 additions and 6 deletions.
38 changes: 32 additions & 6 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,41 @@
name: GCP CI/CD
yon:
name: GCP CI/CD TEST
on:
pull_request:
types:
- closed

jobs:
if_merged:
if: github.event.pull_request.merged == true && github.head_ref == 'Backend'
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
steps:
- name: Backend PR Merge
- name: executing remote ssh commands using ssh key
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
key: ${{ secrets.SSH_KEY }}
passphrase: ${{ secrets.PASSPHRASE }}
port: 22

# npm 의존성 설치
- name: npm install
run: |
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: |
PR_BRANCH="${{ github.head_ref }}"
echo $PR_BRANCH
cd ${{ secrets.PWD }}/BackendJS/BackendTS
npm install
pm2 restart Traffic

0 comments on commit 85f6752

Please sign in to comment.