Skip to content

Commit

Permalink
ci/cd: set variable 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
Curry4182 committed Mar 20, 2024
1 parent e83f2b3 commit f814009
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/CICD.yml
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,30 @@ jobs:
echo "No container found running on port $PORT"
fi
set-variable:
runs-on: [ self-hosted, loadbalancer-server ]
outputs:
is_blue_env: ${{ steps.check-blue.outputs.is_blue_env }}
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Check Blue Environment
id: check-blue
run: |
IS_BLUE_ENV=$(sh /usr/local/bin/scripts/is_blue_env.sh)
echo "::set-output name=is_blue_env::$IS_BLUE_ENV"
shell: bash

- name: Print if Environment is Blue
run: |
if [[ "${{ steps.check-blue.outputs.is_blue_env }}" == "true" ]]; then
echo "Environment is BLUE"
else
echo "Environment is NOT BLUE"
fi
shell: bash

switch-environment:
needs: [ run-docker-image-on-server-1, run-docker-image-on-server-2 ]
runs-on: [ self-hosted, loadbalancer-server, set-variable ]
Expand Down

0 comments on commit f814009

Please sign in to comment.