From 0139f0a11889d6fe36884fbe7c5f5d488a0ebbc8 Mon Sep 17 00:00:00 2001 From: 0tae Date: Mon, 27 Jan 2025 23:06:49 +0900 Subject: [PATCH] =?UTF-8?q?chore(CI/CD)=20:=20Dockerfile-staging=20?= =?UTF-8?q?=ED=8C=8C=EC=9D=BC=EA=B2=BD=EB=A1=9C=20=EC=88=98=EC=A0=95=20?= =?UTF-8?q?=EB=B0=8F=20DOCKER-CD-STAGING.yml=20login=20docker=20hub=20?= =?UTF-8?q?=EB=82=B4=EC=9A=A9=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/DOCKER-CD-STAGING.yml | 12 ++++++------ Dockerfile-staging | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/DOCKER-CD-STAGING.yml b/.github/workflows/DOCKER-CD-STAGING.yml index de70500..28c0a88 100644 --- a/.github/workflows/DOCKER-CD-STAGING.yml +++ b/.github/workflows/DOCKER-CD-STAGING.yml @@ -5,8 +5,8 @@ on: jobs: ci: - # Using Environment - prod 환경 사용 - # environment: prod + # Using Environment - staging 환경 사용 + # environment: staging runs-on: ubuntu-24.04 env: working-directory: . @@ -38,7 +38,7 @@ jobs: run: | mkdir -p ./src/main/resources && cd $_ touch ./application.yml - echo "${{ secrets.YML }}" > ./application.yml + echo "${{ secrets.YML_ACTIVE_STAGING }}" > ./application.yml cat ./application.yml working-directory: ${{ env.working-directory }} @@ -46,7 +46,7 @@ jobs: run: | cd ./src/main/resources touch ./application-staging.yml - echo "${{ secrets.PROD_YML }}" > ./application-staging.yml + echo "${{ secrets.STAGING_YML }}" > ./application-staging.yml working-directory: ${{ env.working-directory }} - name: 빌드 @@ -62,8 +62,8 @@ jobs: - name: login docker hub uses: docker/login-action@v2.2.0 with: - username: ${{ secrets.STAGING_DOCKER_LOGIN_USERNAME }} - password: ${{ secrets.STAGING_DOCKER_LOGIN_ACCESSTOKEN }} + username: ${{ secrets.PROD_DOCKER_LOGIN_USERNAME }} + password: ${{ secrets.PROD_DOCKER_LOGIN_ACCESSTOKEN }} - name: docker image 빌드 및 푸시 run: | diff --git a/Dockerfile-staging b/Dockerfile-staging index 2eaf87f..0841add 100644 --- a/Dockerfile-staging +++ b/Dockerfile-staging @@ -5,7 +5,7 @@ FROM amazoncorretto:21 WORKDIR /app # Copy JAR file to the container -COPY build/libs/noostak-0.0.1-SNAPSHOT.jar /app/noostak.jar +COPY build/libs/noostak-0.0.1-SNAPSHOT.jar /app/noostak-0.0.1-SNAPSHOT.jar # Set environment variables for timezone and Spring profile ENV TZ=Asia/Seoul @@ -15,4 +15,4 @@ ENV SPRING_PROFILES_ACTIVE=staging EXPOSE 8080 # Run the application -CMD ["java", "-Duser.timezone=$TZ", "-jar", "-Dspring.profiles.active=$SPRING_PROFILES_ACTIVE", "noostak.jar"] +CMD ["java", "-Duser.timezone=$TZ", "-jar", "-Dspring.profiles.active=$SPRING_PROFILES_ACTIVE", "noostak-0.0.1-SNAPSHOT.jar"]