From c08c8cef22608a12a0f6c4946409fe105415835e Mon Sep 17 00:00:00 2001 From: Ivan Dyachkov Date: Sat, 11 May 2024 10:18:46 +0200 Subject: [PATCH] ci(docker): login to specific docker registry only when necessary --- .github/workflows/build_and_push_docker_images.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_and_push_docker_images.yaml b/.github/workflows/build_and_push_docker_images.yaml index dbca3fe38..ec6747c32 100644 --- a/.github/workflows/build_and_push_docker_images.yaml +++ b/.github/workflows/build_and_push_docker_images.yaml @@ -142,14 +142,14 @@ jobs: - name: Login to hub.docker.com uses: docker/login-action@e92390c5fb421da1463c202d546fed0ec5c39f20 # v3.1.0 - if: inputs.publish || github.repository_owner != 'emqx' + if: inputs.publish && contains(matrix.profile[1], 'docker.io') with: username: ${{ secrets.DOCKER_HUB_USER }} password: ${{ secrets.DOCKER_HUB_TOKEN }} - name: Login to AWS ECR uses: docker/login-action@e92390c5fb421da1463c202d546fed0ec5c39f20 # v3.1.0 - if: inputs.publish || github.repository_owner != 'emqx' + if: inputs.publish && contains(matrix.profile[1], 'public.ecr.aws') with: registry: public.ecr.aws username: ${{ secrets.AWS_ACCESS_KEY_ID }}