From 995b53532ba0bbc1ac2f70cc912ae1db29959d01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B7=B9=EB=9D=BD=EC=BD=94=EB=94=A9?= <50691225+DongGeon0908@users.noreply.github.com> Date: Thu, 1 Aug 2024 16:24:06 +0900 Subject: [PATCH] Update docker-gradle-poc.yml --- .github/workflows/docker-gradle-poc.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/docker-gradle-poc.yml b/.github/workflows/docker-gradle-poc.yml index ad3736d..add8a4a 100644 --- a/.github/workflows/docker-gradle-poc.yml +++ b/.github/workflows/docker-gradle-poc.yml @@ -84,7 +84,7 @@ jobs: shell: bash - name: Make image tag - run: echo "IMAGE_TAG=$ACTIVE_PROFILE-${GITHUB_SHA::7}" >> $GITHUB_ENV # activeProfile-커밋 hash 값 + run: echo "IMAGE_TAG=v${{ GITHUB_SHA::7 }}" >> $GITHUB_ENV # v-커밋 hash 값 # DockerHub 로그인 - name: docker login @@ -95,11 +95,11 @@ jobs: # Docker 이미지 빌드 - name: docker image build - run: docker build -t ${{ secrets.DOCKER_USERNAME }}/hero-alignlab-api:${{env.IMAGE_TAG}} . + run: docker build -t ${{ secrets.DOCKER_USERNAME }}/hero-alignlab-api:${{ env.IMAGE_TAG }} . - # Docker Hub 이미지 푸시 + # Docker Hub 이미지 푸시 - name: docker Hub push - run: docker push ${{ secrets.DOCKER_USERNAME }}/hero-alignlab-api:${{env.IMAGE_TAG}} + run: docker push ${{ secrets.DOCKER_USERNAME }}/hero-alignlab-api:${{ env.IMAGE_TAG }} # Deploy Hero Service - name: Deploy and Start Spring Boot Application @@ -112,8 +112,8 @@ jobs: sudo echo "IMAGE_TAG=${{ env.IMAGE_TAG }}" >> .env echo "${{ secrets.DOCKER_TOKEN }}" | sudo docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin sudo docker ps - sudo docker pull ${{ secrets.DOCKER_USERNAME }}/hero-alignlab-api:${{env.IMAGE_TAG}} + sudo docker pull ${{ secrets.DOCKER_USERNAME }}/hero-alignlab-api:${{ env.IMAGE_TAG }} sudo docker stop server || true sudo docker rm server || true # 중복된 이름 문제 해결 - sudo docker run -d -p 8080:8080 --name server ${{ secrets.DOCKER_USERNAME }}/hero-alignlab-api:${{env.IMAGE_TAG}} + sudo docker run -d -p 8080:8080 --name server ${{ secrets.DOCKER_USERNAME }}/hero-alignlab-api:${{ env.IMAGE_TAG }} sudo docker image prune -f