From 8b6afff0f6981091942cb5b37a9315321130fa6b Mon Sep 17 00:00:00 2001 From: sandhya1874 Date: Tue, 8 Oct 2024 21:37:33 +0100 Subject: [PATCH] . --- .../build_multiplatform_docker/action.yml | 34 +++++++++---------- .../workflows/build_multiplatform_docker.yml | 3 +- 2 files changed, 19 insertions(+), 18 deletions(-) diff --git a/.github/actions/build-test-and-deploy/build_multiplatform_docker/action.yml b/.github/actions/build-test-and-deploy/build_multiplatform_docker/action.yml index befff44..b71b5c1 100644 --- a/.github/actions/build-test-and-deploy/build_multiplatform_docker/action.yml +++ b/.github/actions/build-test-and-deploy/build_multiplatform_docker/action.yml @@ -25,14 +25,14 @@ inputs: description: App version required: true type: string - # docker_registry_username: - # description: Docker registry username - # required: true - # type: string - # docker_registry_token: - # description: Docker registry token - # required: true - # type: string + HMPPS_QUAYIO_USER: + description: Docker registry username + required: false + type: string + HMPPS_QUAYIO_TOKEN: + description: Docker registry token + required: false + type: string # secrets: # HMPPS_QUAYIO_USER: @@ -46,13 +46,13 @@ runs: - uses: actions/checkout@v4 - uses: docker/setup-qemu-action@v2 - uses: docker/setup-buildx-action@v2 - # - name: Docker login if Docker registry is quay.io - # if: ${{ inputs.docker_registry == 'quay.io' }} - # uses: docker/login-action@v2 - # with: - # registry: ${{ inputs.docker_registry }} - # username: ${{ secrets.HMPPS_QUAYIO_USER }} - # password: ${{ secrets.HMPPS_QUAYIO_TOKEN }} + - name: Docker login if Docker registry is quay.io + if: ${{ inputs.docker_registry == 'quay.io' }} + uses: docker/login-action@v2 + with: + registry: ${{ inputs.docker_registry }} + username: ${{ inputs.HMPPS_QUAYIO_USER }} + password: ${{ inputs.HMPPS_QUAYIO_TOKEN }} - name: Docker login if Docker registry is ghcr.io if: ${{ inputs.docker_registry == 'ghcr.io' }} @@ -72,8 +72,8 @@ runs: provenance: false build-args: | "BUILD_NUMBER=${{ inputs.app_version }}" - "GIT_REF=$${{ github.head_ref }}" - "GIT_BRANCH=$${{ github.ref_name }}" + "GIT_REF=${{ github.head_ref }}" + "GIT_BRANCH=${{ github.ref_name }}" tags: | ${{ inputs.docker_registry}}/${{ inputs.registry_org }}/${{ github.event.repository.name }}:latest ${{ inputs.docker_registry}}/${{ inputs.registry_org }}/${{ github.event.repository.name }}:${{ inputs.app_version }} diff --git a/.github/workflows/build_multiplatform_docker.yml b/.github/workflows/build_multiplatform_docker.yml index 0fa96af..124a2ec 100644 --- a/.github/workflows/build_multiplatform_docker.yml +++ b/.github/workflows/build_multiplatform_docker.yml @@ -57,7 +57,6 @@ jobs: push: ${{ inputs.push }} app_version: ${{ needs.create_app_version.outputs.version }} - - uses: ministryofjustice/hmpps-github-actions/.github/actions/build-test-and-deploy/build_multiplatform_docker@feat/HEAT-344-share-app-version-across-jobs if: ${{ inputs.docker_registry == 'quay.io' }} with: @@ -67,6 +66,8 @@ jobs: additional_docker_tag: ${{ inputs.additional_docker_tag }} push: ${{ inputs.push }} app_version: ${{ needs.create_app_version.outputs.version }} + HMPPS_QUAYIO_USER: ${{ secrets.HMPPS_QUAYIO_USER }} + HMPPS_QUAYIO_TOKEN: ${{ secrets.HMPPS_QUAYIO_TOKEN}}