From 2ad465cafc3bcfbf0ba40e3c0d8c648745612af3 Mon Sep 17 00:00:00 2001 From: lja3723 Date: Fri, 8 Nov 2024 00:28:04 +0900 Subject: [PATCH 1/2] =?UTF-8?q?chore:=20push=EC=9D=BC=20=EB=95=8C=EB=A7=8C?= =?UTF-8?q?=20Deploy=EB=90=98=EB=8F=84=EB=A1=9D=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/gradle.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 10d7c877..4b5ea7ff 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -53,6 +53,7 @@ jobs: Deploy: runs-on: ubuntu-22.04 needs: Build + if: github.event_name == 'push' steps: - name: Pull New Docker Image uses: appleboy/ssh-action@master From ed763e019b8f581fb087e63e6c32ca89a3edb17d Mon Sep 17 00:00:00 2001 From: lja3723 Date: Fri, 8 Nov 2024 00:32:22 +0900 Subject: [PATCH 2/2] =?UTF-8?q?chore:=20push=EC=9D=BC=20=EB=95=8C=EB=A7=8C?= =?UTF-8?q?=20Docker=20push=20=EB=90=98=EB=8F=84=EB=A1=9D=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/gradle.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 4b5ea7ff..50aee2a3 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -38,15 +38,18 @@ 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단계: 서버에 배포