From d3fdabedc118fc6a0abd8eeb2ac58df38ec0990a Mon Sep 17 00:00:00 2001 From: Jangan Lee Date: Fri, 8 Nov 2024 00:33:30 +0900 Subject: [PATCH] =?UTF-8?q?[Weekly/10/Chore/Deploy]=20push=EC=9D=BC=20?= =?UTF-8?q?=EB=95=8C=EB=A7=8C=20Deploy=EB=90=98=EB=8F=84=EB=A1=9D=20?= =?UTF-8?q?=EC=88=98=EC=A0=95=20(#83)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore: push일 때만 Deploy되도록 수정 * chore: push일 때만 Docker push 되도록 수정 --- .github/workflows/gradle.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 10d7c877..50aee2a3 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -38,21 +38,25 @@ jobs: ./gradlew clean build -x test - name: Docker Hub Login + if: github.event_name == 'push' uses: docker/login-action@v3 with: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_TOKEN }} - name: Docker Build + if: github.event_name == 'push' run: docker build -f Dockerfile --build-arg DEPENDENCY=build/dependency -t ${{ secrets.DOCKER_REPO_FULLNAME }} . - name: Docker Push + if: github.event_name == 'push' run: docker push ${{ secrets.DOCKER_REPO_FULLNAME }} ## 2단계: 서버에 배포 Deploy: runs-on: ubuntu-22.04 needs: Build + if: github.event_name == 'push' steps: - name: Pull New Docker Image uses: appleboy/ssh-action@master