Skip to content

백엔드 무중단 배포 #29

백엔드 무중단 배포

백엔드 무중단 배포 #29

name: Blue-Green Backend Production Deploy (CD)
on:
workflow_dispatch:
jobs:
deploy:
name: Deploy Backend Production Server
runs-on: shook-nginx-runner
steps:
- name: Checkout Source Code
uses: actions/checkout@v2
with:
token: ${{ secrets.SUBMODULE_PAT }}
submodules: recursive
- name: Grant execute permission to gradlew
shell: bash
run: chmod +x backend/gradlew
- name: Check Java Version
shell: bash
run: java --version
- name: Gradlew bootJar
shell: bash
run: |
cd backend
./gradlew bootJar
- name: Copy Jar
shell: bash
run: cp backend/build/libs/shook-0.0.1-SNAPSHOT.jar /home/ubuntu/application-jar
- name: Backend Deploy
shell: bash
run: bash /home/ubuntu/blue-green.sh
switch-server:
name: Switch Backend Production Server
runs-on: shook-prod
needs: deploy
steps:
- name: Run switch_server.sh
shell: bash
run: bash /home/ubuntu/blue-green/server_switch.sh