workflows: don't login to Docker Hub when not pushing images

Minor safety improvement, images are not pushed anyway in this case, but it
makes little sense logging in as well.
This commit is contained in:
Roman Khimov 2022-07-21 15:32:00 +03:00
parent 7118b4f4ea
commit 913dea84af

View file

@ -93,6 +93,7 @@ jobs:
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
if: ${{ github.event_name == 'release' || (github.event_name == 'workflow_dispatch' && github.event.inputs.push_image == 'true') }}
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
@ -136,6 +137,7 @@ jobs:
cache: true
- name: Login to DockerHub
if: ${{ github.event_name == 'release' || (github.event_name == 'workflow_dispatch' && github.event.inputs.push_image == 'true') }}
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}