From fe62da951215474c29146e7ac0555537638b9b8d Mon Sep 17 00:00:00 2001 From: Alexander Taepper Date: Fri, 15 Nov 2024 08:12:37 +0100 Subject: [PATCH] correct usage of matrix parameter and also check for the platform --- .github/workflows/dependencies.yml | 11 ++++++++--- .github/workflows/imageAndTests.yml | 2 +- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.github/workflows/dependencies.yml b/.github/workflows/dependencies.yml index 22f982d36..1f27af3c6 100644 --- a/.github/workflows/dependencies.yml +++ b/.github/workflows/dependencies.yml @@ -46,16 +46,21 @@ jobs: - name: Check if image exists run: | - EXISTS=$(docker manifest inspect ${{ env.DOCKER_DEPENDENCY_IMAGE_NAME }}:${{ env.DIR_HASH }} > /dev/null 2>&1 && echo "true" || echo "false") - echo "CACHE_HIT=$EXISTS" >> $GITHUB_ENV + if [[ $(docker manifest inspect ${{ env.DOCKER_DEPENDENCY_IMAGE_NAME }}:${{ env.DIR_HASH }} > /dev/null 2>&1 ]]; then + echo "Cache hit, do not require rebuild of this docker image. Retagging old image instead." + echo "CACHE_HIT=true" >> $GITHUB_ENV + else + echo "CACHE_HIT=false" >> $GITHUB_ENV + fi - name: Determine platform build necessity + if: env.CACHE_HIT == 'false' id: platform-check run: | if [[ "${{ matrix.platform }}" == "linux/amd64" || "${{ github.event_name }}" == "workflow_dispatch" || "${{ github.ref }}" == "refs/heads/main" ]]; then echo "PLATFORM_BUILD=true" >> $GITHUB_ENV else - echo "Skipping Platform Build for ${{ matrix.plaform }}" + echo "Skipping build for this platform" echo "PLATFORM_BUILD=false" >> $GITHUB_ENV fi shell: bash diff --git a/.github/workflows/imageAndTests.yml b/.github/workflows/imageAndTests.yml index aae6f66ce..08629c33c 100644 --- a/.github/workflows/imageAndTests.yml +++ b/.github/workflows/imageAndTests.yml @@ -32,7 +32,7 @@ jobs: strategy: matrix: args: - ${{ contains(github.event_name, 'workflow_dispatch') || github.ref == 'refs/heads/main' ? ['linux/amd64', 'linux/arm64']: [ 'linux/amd64' ] }} + ['linux/amd64', 'linux/arm64'] permissions: packages: write steps: