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