From d9520af85e7a33523a0440917aa8a27cd78d774f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9E=84=EC=88=98=EB=B9=88?= Date: Thu, 19 Sep 2024 17:29:43 +0900 Subject: [PATCH] =?UTF-8?q?A=20=EB=A1=A4=EB=B0=B1=20=EC=8B=A4=ED=8C=A8=20?= =?UTF-8?q?=ED=85=8C=EC=8A=A4=ED=8A=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/backend_cd.yml | 10 +++++----- backend/src/main/java/develup/api/HealthApi.java | 2 ++ 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/backend_cd.yml b/.github/workflows/backend_cd.yml index c642d866..3e353302 100644 --- a/.github/workflows/backend_cd.yml +++ b/.github/workflows/backend_cd.yml @@ -86,7 +86,7 @@ jobs: healthCheckA: name: 🙏 Server A Health Check needs: deployToA - if: success() + continue-on-error: true defaults: run: working-directory: backend @@ -98,7 +98,7 @@ jobs: rollBackA: name: 🚀 Server A RollBack needs: [healthCheckA, findPreviousImageVersion] - if: failure() + if: ${{needs.healthCheckA.result == 'failure'}} runs-on: [ self-hosted, devel-up-prod-a ] defaults: run: @@ -122,7 +122,7 @@ jobs: healthCheckAAfterRollBack: name: 🙏 Server A Health Check After RollBack needs: rollBackA - if : ${{needs.rollBackA.result == 'success'}} + continue-on-error: true defaults: run: working-directory: backend @@ -134,7 +134,7 @@ jobs: deployToB: name: 🚀 Server B Deployment needs: healthCheckA - if: success() + if: ${{needs.healthCheckA.result == 'success'}} runs-on: [ self-hosted, devel-up-prod-b ] defaults: run: @@ -158,7 +158,7 @@ jobs: healthCheckB: name: 🙏 Server B Health Check needs: deployToB - if: success() + continue-on-error: true defaults: run: working-directory: backend diff --git a/backend/src/main/java/develup/api/HealthApi.java b/backend/src/main/java/develup/api/HealthApi.java index 179e014b..50d346bd 100644 --- a/backend/src/main/java/develup/api/HealthApi.java +++ b/backend/src/main/java/develup/api/HealthApi.java @@ -10,6 +10,8 @@ public class HealthApi { @GetMapping("/health") public ResponseEntity> health() { + + return ResponseEntity.status(400).body(new ApiResponse<>("up")); } }