diff --git a/.github/workflows/production-deploy.yml b/.github/workflows/production-deploy.yml index 671b668..9cb358c 100644 --- a/.github/workflows/production-deploy.yml +++ b/.github/workflows/production-deploy.yml @@ -68,9 +68,8 @@ jobs: envs: NLB_ID,ACCESS_TOKEN_SECRET_KEY,REFRESH_TOKEN_SECRET_KEY,DB_URL,DB_USERNAME,DB_PASSWORD script: | cd ~/snackgame-server/repo - git fetch origin main - git checkout -B main origin/main - git pull --ff-only origin main --no-recurse-submodules + git fetch origin main + git reset --hard origin/main chmod +x scripts/deploy-rolling.sh scripts/deploy-rolling.sh \ ${{ secrets.NLB_BACKEND_02_HTTP }} \ @@ -99,8 +98,7 @@ jobs: script: | cd ~/snackgame-server/repo git fetch origin main - git checkout -B main origin/main - git pull --ff-only origin main --no-recurse-submodules + git reset --hard origin/main chmod +x scripts/deploy-rolling.sh scripts/deploy-rolling.sh \ ${{ secrets.NLB_BACKEND_01_HTTP }} \ diff --git a/scripts/deploy-rolling.sh b/scripts/deploy-rolling.sh index 6e3776a..57a83dd 100755 --- a/scripts/deploy-rolling.sh +++ b/scripts/deploy-rolling.sh @@ -36,20 +36,18 @@ set_drain() { --network-load-balancer-id "$NLB_ID" \ --backend-set-name snackgame-http \ --backend-name "$HTTP_BACKEND" \ - --is-drain "$is_drain" + --is-drain "$is_drain" \ + --wait-for-state SUCCEEDED \ + --max-wait-seconds 120 oci nlb backend update \ --auth instance_principal \ --network-load-balancer-id "$NLB_ID" \ --backend-set-name snackgame-https \ --backend-name "$HTTPS_BACKEND" \ - --is-drain "$is_drain" - - - if [ "$is_drain" = "true" ]; then - echo "[NLB] 드레인 적용 대기 중 (10초)..." - sleep 10 - fi + --is-drain "$is_drain" \ + --wait-for-state SUCCEEDED \ + --max-wait-seconds 120 }