login to docker hub only if we need to be logged in

This commit is contained in:
Athou
2024-01-30 22:28:05 +01:00
parent 7b8c0ac6ff
commit 6d74b50751

View File

@@ -43,7 +43,7 @@ jobs:
# Docker
- name: Login to Container Registry
uses: docker/login-action@v3
if: ${{ matrix.java == '17' && github.event_name != 'pull_request' }}
if: ${{ matrix.java == '17' && (github.ref_type == 'tag' || github.ref_name == 'master') }}
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}