From 17a032288b1f2a396679d4e816fb92d935c08bac Mon Sep 17 00:00:00 2001 From: Matthew Horridge Date: Fri, 10 May 2024 15:08:19 -0700 Subject: [PATCH] Added workflow to publish image to DockerHub --- .github/workflows/pub-docker-hub.yaml | 29 +++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 .github/workflows/pub-docker-hub.yaml diff --git a/.github/workflows/pub-docker-hub.yaml b/.github/workflows/pub-docker-hub.yaml new file mode 100644 index 0000000..3095f57 --- /dev/null +++ b/.github/workflows/pub-docker-hub.yaml @@ -0,0 +1,29 @@ +name: Publish Docker image to Docker Hub +on: + release: + types: + - published + +jobs: + publish: + runs-on: ubuntu-latest + steps: + - name: Login to Docker Hub + uses: docker/login-action@v2 + with: + username: ${{secrets.DOCKER_USERNAME}} + password: ${{secrets.DOCKER_PASSWORD}} + - uses: actions/checkout@v3 + - name: Set up Maven Central Repository + uses: actions/setup-java@v3 + with: + java-version: '17' + distribution: 'adopt' + server-id: docker.io + server-username: DOCKER_USERNAME + server-password: DOCKER_PASSWORD + - name: Publish package + run: mvn --batch-mode -Prelease package dockerfile:push +env: + DOCKER_USERNAME: ${{secrets.DOCKER_USERNAME}} + DOCKER_TOKEN: ${{secrets.DOCKER_PASSWORD}} \ No newline at end of file