From 1482798b6a0d3c934b85bd2bc9426de8ee960daf Mon Sep 17 00:00:00 2001 From: Matthew Horridge Date: Fri, 10 May 2024 13:09:32 -0700 Subject: [PATCH] Update pub-docker-hub.yaml --- .github/workflows/pub-docker-hub.yaml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pub-docker-hub.yaml b/.github/workflows/pub-docker-hub.yaml index dd0ee69..7ba5413 100644 --- a/.github/workflows/pub-docker-hub.yaml +++ b/.github/workflows/pub-docker-hub.yaml @@ -1,12 +1,18 @@ name: Publish Docker image to Docker Hub on: - release: - types: [released] + push: + branches: + - main jobs: publish: runs-on: ubuntu-latest steps: + - name: Login to Docker Hub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} - uses: actions/checkout@v3 - name: Set up Maven Central Repository uses: actions/setup-java@v3 @@ -17,7 +23,7 @@ jobs: server-username: DOCKER_USERNAME server-password: DOCKER_PASSWORD - name: Publish package - run: mvn --batch-mode -Prelease -Ddockerfile.username=${{secrets.DOCKER_USERNAME}} -Ddockerfile.password=${{secrets.DOCKER_TOKEN}} package dockerfile:push + run: mvn --batch-mode -Prelease package dockerfile:push env: DOCKER_USERNAME: ${{secrets.DOCKER_USERNAME}} DOCKER_TOKEN: ${{secrets.DOCKER_TOKEN}} \ No newline at end of file