From d18f48f58bc539629f4e777bf7823dab7bdcf457 Mon Sep 17 00:00:00 2001 From: Riccardo Piccoli Date: Thu, 27 Jun 2024 18:58:03 +0200 Subject: [PATCH] github workflow: login first, then build and push Signed-off-by: Riccardo Piccoli --- .github/workflows/release.yaml | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index ee8949a0..1652c532 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -28,15 +28,17 @@ jobs: run: | sed -i "s,quay.io/edge-infrastructure/openshift-capi-agent-bootstrap:latest,${{ secrets.REGISTRY_SERVER }}/${{ secrets.REGISTRY_NAMESPACE }}/${{ env.controlplane_image_name }}:${{env.VERSION}}," bootstrap-components.yaml sed -i "s,quay.io/edge-infrastructure/openshift-capi-agent-controlplane:latest,${{ secrets.REGISTRY_SERVER }}/${{ secrets.REGISTRY_NAMESPACE }}/${{ env.controlplane_image_name }}:${{env.VERSION}}," controlplane-components.yaml + - name: Login to Docker Hub + uses: docker/login-action@v3 + with: + registry: ${{ secrets.REGISTRY_SERVER }} + username: ${{ secrets.REGISTRY_USERNAME }} + password: ${{ secrets.REGISTRY_PASSWORD }} - name: Build and publish bootstrap image to Quay uses: docker/build-push-action@v5 with: push: true context: ${{ env.context }} - registry: ${{ secrets.REGISTRY_SERVER }} - repository: ${{ secrets.REGISTRY_NAMESPACE }}/${{ env.bootstrap_image_name }} - username: ${{ secrets.REGISTRY_USERNAME }} - password: ${{ secrets.REGISTRY_PASSWORD }} tags: "${{ secrets.REGISTRY_SERVER }}/${{ secrets.REGISTRY_NAMESPACE }}/${{ env.controlplane_image_name }}:${{env.VERSION}}, ${{ secrets.REGISTRY_SERVER }}/${{ secrets.REGISTRY_NAMESPACE }}/${{ env.controlplane_image_name }}:latest" build-args: "PROVIDER=bootstrap" - name: Build and publish bootstrap image to Quay @@ -44,9 +46,6 @@ jobs: with: push: true context: ${{ env.context }} - registry: ${{ secrets.REGISTRY_SERVER }} - repository: ${{ secrets.REGISTRY_NAMESPACE }}/${{ env.controlplane_image_name }} - password: ${{ secrets.REGISTRY_PASSWORD }} tags: "${{ secrets.REGISTRY_SERVER }}/${{ secrets.REGISTRY_NAMESPACE }}/${{ env.controlplane_image_name }}:${{env.VERSION}}, ${{ secrets.REGISTRY_SERVER }}/${{ secrets.REGISTRY_NAMESPACE }}/${{ env.controlplane_image_name }}:latest" build-args: "PROVIDER=controlplane" - name: Create GitHub Release