From 152d752c28bd96638c1d15b0ec93024b6a1bd05c Mon Sep 17 00:00:00 2001 From: Christian Kuhtz Date: Wed, 10 Jul 2024 22:56:02 +0000 Subject: [PATCH] modify cache directory name to account for / in platform name --- .github/workflows/docker-images.yml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker-images.yml b/.github/workflows/docker-images.yml index a5d54cd..5e1be05 100644 --- a/.github/workflows/docker-images.yml +++ b/.github/workflows/docker-images.yml @@ -32,13 +32,23 @@ jobs: password: ${{ secrets.GHCR_TOKEN }} logout: false + - name: Create a variable with platform '${{ matrix.platform }}' value + run: echo "PLATFORM=${{ matrix.platform }}" >> $GITHUB_ENV + + - name: Swap / for - in '${{ matrix.platform }}' and create local_platform variable + id: local_platform + run: | + LOCAL_PLATFORM="${PLATFORM//\/\-}" + echo "LOCAL_PLATFORM=${LOCAL_PLATFORM}" >> $GITHUB_ENV + echo "::set-output name=local_platform::${LOCAL_PLATFORM}" + - name: Cache Docker layers uses: actions/cache@v3 with: path: /tmp/.buildx-cache - key: ${{ runner.os }}-${{ matrix.platform }}-buildx-${{ github.sha }} + key: ${{ runner.os }}-${{ steps.local_platform.outputs.local_platform }}-buildx-${{ github.sha }} restore-keys: | - ${{ runner.os }}-${{ matrix.platform }}-buildx- + ${{ runner.os }}-${{ steps.local_platform.outputs.local_platform }}-buildx- - name: Set up QEMU uses: docker/setup-qemu-action@v3