From b092ac72bdaadb722140eed4d6f7dc51c99d7bd0 Mon Sep 17 00:00:00 2001 From: Aina Sitraka <35221835+aynsix@users.noreply.github.com> Date: Mon, 2 Dec 2024 12:10:13 +0300 Subject: [PATCH] PS-744: CI - docker image - stop generating untagged images from AWS registry when pushing a new build (#495) * stop generation untagged image in registry * update build-push-action version --- .github/workflows/build.yaml | 3 ++- .github/workflows/build_api.yaml | 9 ++++++--- .github/workflows/build_base.yaml | 3 ++- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 58e9560ba..5dceb61e8 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -49,11 +49,12 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Build and Push - uses: docker/build-push-action@v4 + uses: docker/build-push-action@v6 with: context: ${{ inputs.withLibs && './' || inputs.context }} file: ${{ inputs.context }}/Dockerfile target: ${{ inputs.target }} + provenance: false push: true cache-from: type=registry,ref=${{ env.REGISTRY_NAMESPACE }}${{ inputs.image }}:build-cache cache-to: type=registry,mode=max,ref=${{ env.REGISTRY_NAMESPACE }}${{ inputs.image }}:build-cache diff --git a/.github/workflows/build_api.yaml b/.github/workflows/build_api.yaml index 39bd37cd6..c18e6dcd9 100644 --- a/.github/workflows/build_api.yaml +++ b/.github/workflows/build_api.yaml @@ -39,11 +39,12 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Build and Push API PHP - uses: docker/build-push-action@v4 + uses: docker/build-push-action@v6 with: context: ${{ inputs.withLibs && './' || inputs.context }} file: ${{ inputs.context }}/Dockerfile target: api-php + provenance: false push: true cache-from: type=registry,ref=${{ env.REGISTRY_NAMESPACE }}${{ inputs.prefix }}-api-php:build-cache cache-to: type=registry,mode=max,ref=${{ env.REGISTRY_NAMESPACE }}${{ inputs.prefix }}-api-php:build-cache @@ -55,11 +56,12 @@ jobs: ${{ env.REGISTRY_NAMESPACE }}${{ inputs.prefix }}-api-php:${{ env.DOCKER_TAG }} - name: Build and Push API NGINX - uses: docker/build-push-action@v4 + uses: docker/build-push-action@v6 with: context: ${{ inputs.withLibs && './' || inputs.context }} file: ${{ inputs.context }}/Dockerfile target: api-nginx + provenance: false push: true cache-from: type=registry,ref=${{ env.REGISTRY_NAMESPACE }}${{ inputs.prefix }}-api-nginx:build-cache cache-to: type=registry,mode=max,ref=${{ env.REGISTRY_NAMESPACE }}${{ inputs.prefix }}-api-nginx:build-cache @@ -70,11 +72,12 @@ jobs: ${{ env.REGISTRY_NAMESPACE }}${{ inputs.prefix }}-api-nginx:${{ env.DOCKER_TAG }} - name: Build and Push Worker - uses: docker/build-push-action@v4 + uses: docker/build-push-action@v6 with: context: ${{ inputs.withLibs && './' || inputs.context }} file: ${{ inputs.context }}/Dockerfile target: worker + provenance: false push: true cache-from: type=registry,ref=${{ env.REGISTRY_NAMESPACE }}${{ inputs.prefix }}-worker:build-cache cache-to: type=registry,mode=max,ref=${{ env.REGISTRY_NAMESPACE }}${{ inputs.prefix }}-worker:build-cache diff --git a/.github/workflows/build_base.yaml b/.github/workflows/build_base.yaml index faa135d22..5bc02c671 100644 --- a/.github/workflows/build_base.yaml +++ b/.github/workflows/build_base.yaml @@ -38,11 +38,12 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Build and Push - uses: docker/build-push-action@v4 + uses: docker/build-push-action@v6 with: context: ${{ inputs.context }} target: ${{ inputs.target }} file: ${{ inputs.context }}/Dockerfile + provenance: false push: true cache-from: type=registry,ref=${{ env.REGISTRY_NAMESPACE }}${{ inputs.image }}:build-cache cache-to: type=registry,mode=max,ref=${{ env.REGISTRY_NAMESPACE }}${{ inputs.image }}:build-cache