Skip to content

Commit

Permalink
chore: #13 Set target IP 내용 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
kyxxgsoo authored Jul 16, 2024
1 parent 1982961 commit 3debc50
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions .github/workflows/CICD.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,14 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
token: ${{ secrets.GIT_ACCESS_TOKEN }}
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'

- name: Build with Gradle Wrapper
run: |
echo ${{ secrets.APPLICATION_SECRET }} | base64 --decode > ./config/application-secret.yml
cat ./config/application-secret.yml
./gradlew build -x test
run: ./gradlew build

- name: Login to DockerHub
uses: docker/login-action@v1
Expand All @@ -36,7 +30,7 @@ jobs:
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build Docker
run: docker build --platform linux/amd64 -f ./Dockerfile -t ${{ secrets.DOCKERHUB_USERNAME }}/plat_server .
run: docker build --platform linux/amd64 -t ${{ secrets.DOCKERHUB_USERNAME }}/plat_server .
- name: Push Docker
run: docker push ${{ secrets.DOCKERHUB_USERNAME }}/plat_server:latest

Expand All @@ -54,11 +48,11 @@ jobs:
CURRENT_UPSTREAM=green
fi
echo CURRENT_UPSTREAM=$CURRENT_UPSTREAM >> $GITHUB_ENV
if [ $CURRENT_UPSTREAM = blue ]; then
if [ $CURRENT_UPSTREAM = "blue" ]; then
echo "CURRENT_PORT=8080" >> $GITHUB_ENV
echo "STOPPED_PORT=8081" >> $GITHUB_ENV
echo "TARGET_UPSTREAM=green" >> $GITHUB_ENV
elif [ $CURRENT_UPSTREAM = green ]; then
elif [ $CURRENT_UPSTREAM = "green" ]; then
echo "CURRENT_PORT=8081" >> $GITHUB_ENV
echo "STOPPED_PORT=8080" >> $GITHUB_ENV
echo "TARGET_UPSTREAM=blue" >> $GITHUB_ENV
Expand All @@ -82,7 +76,7 @@ jobs:
uses: jtalk/url-health-check-action@v3
with:
url: http://${{ secrets.PLAT_SERVER_IP }}:${{env.STOPPED_PORT}}/env
max-attempts: 5
max-attempts: 3
retry-delay: 10s

- name: Change nginx upstream
Expand Down

0 comments on commit 3debc50

Please sign in to comment.