Skip to content

Commit

Permalink
Merge pull request #113 from PhilippvK/ci-docker-hub
Browse files Browse the repository at this point in the history
[CI] Add login and push actions for docker hub
  • Loading branch information
PhilippvK authored Jul 27, 2024
2 parents 1749814 + 87e33e5 commit e08fe5e
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,21 @@ jobs:
run: sudo apt-get install -y genisoimage
- name: Build with Maven
run: mvn -B install --file pom.xml
- name: Login to DockerHub
uses: docker/login-action@v2
if: ${{ github.repository == 'philippvk/playforia-minigolf' }}
with:
registry: ${{ secrets.DOCKER_REGISTRY }}
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build Docker image
uses: docker/build-push-action@v5
with:
tags: philippvk/minigolf:latest
tags: ${{ secrets.DOCKER_REGISTRY }}/${{ secrets.DOCKER_NAMESPACE }}/playforia-minigolf:latest
- name: Push Docker image
uses: docker/build-push-action@v5
if: ${{ github.repository == 'philippvk/playforia-minigolf' && github.ref == 'refs/heads/master' && github.event_name == 'pull_request' }}
with:
push: true
tags: ${{ secrets.DOCKER_REGISTRY }}/${{ secrets.DOCKER_NAMESPACE }}/playforia-minigolf:latest

0 comments on commit e08fe5e

Please sign in to comment.