From 5405f6c58b085aa8eaae26ac93dae2cda8dcd2b1 Mon Sep 17 00:00:00 2001 From: Leonard Jonathan Oh Date: Fri, 27 Jan 2023 09:14:13 +0000 Subject: [PATCH] Fix (ci): Fix caching for `docker buildx` --- .github/workflows/ci-master-pr.yml | 396 ++++++++++++++---- .../.github/workflows/ci-master-pr.yml.ps1 | 18 +- 2 files changed, 322 insertions(+), 92 deletions(-) diff --git a/.github/workflows/ci-master-pr.yml b/.github/workflows/ci-master-pr.yml index 71a3ff2..e31f4b3 100644 --- a/.github/workflows/ci-master-pr.yml +++ b/.github/workflows/ci-master-pr.yml @@ -45,8 +45,9 @@ jobs: uses: actions/cache@v3 with: path: /tmp/.buildx-cache - key: ${{ runner.os }}-buildx-${{ github.sha }} + key: ${{ runner.os }}-buildx-${{ env.VARIANT_TAG }}-${{ github.sha }} restore-keys: | + ${{ runner.os }}-buildx-${{ env.VARIANT_TAG }}- ${{ runner.os }}-buildx- - name: Prepare @@ -99,7 +100,7 @@ jobs: ${{ github.repository }}:${{ env.VARIANT_TAG_WITH_REF }} ${{ github.repository }}:${{ env.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max - name: Build and push (master) id: docker_build_master @@ -113,7 +114,8 @@ jobs: tags: | ${{ github.repository }}:${{ env.VARIANT_TAG_WITH_REF }} ${{ github.repository }}:${{ env.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} - cache-to: type=local,dest=/tmp/.buildx-cache + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max - name: Build and push (release) id: docker_build_release @@ -128,7 +130,15 @@ jobs: ${{ github.repository }}:${{ env.VARIANT_TAG_WITH_REF }} ${{ github.repository }}:${{ env.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max + + # Temp fix + # https://github.com/docker/build-push-action/issues/252 + # https://github.com/moby/buildkit/issues/1896 + - name: Move cache + run: | + rm -rf /tmp/.buildx-cache + mv /tmp/.buildx-cache-new /tmp/.buildx-cache - name: List docker images run: docker images @@ -171,8 +181,9 @@ jobs: uses: actions/cache@v3 with: path: /tmp/.buildx-cache - key: ${{ runner.os }}-buildx-${{ github.sha }} + key: ${{ runner.os }}-buildx-${{ env.VARIANT_TAG }}-${{ github.sha }} restore-keys: | + ${{ runner.os }}-buildx-${{ env.VARIANT_TAG }}- ${{ runner.os }}-buildx- - name: Prepare @@ -225,7 +236,7 @@ jobs: ${{ github.repository }}:${{ env.VARIANT_TAG_WITH_REF }} ${{ github.repository }}:${{ env.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max - name: Build and push (master) id: docker_build_master @@ -239,7 +250,8 @@ jobs: tags: | ${{ github.repository }}:${{ env.VARIANT_TAG_WITH_REF }} ${{ github.repository }}:${{ env.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} - cache-to: type=local,dest=/tmp/.buildx-cache + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max - name: Build and push (release) id: docker_build_release @@ -254,7 +266,15 @@ jobs: ${{ github.repository }}:${{ env.VARIANT_TAG_WITH_REF }} ${{ github.repository }}:${{ env.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max + + # Temp fix + # https://github.com/docker/build-push-action/issues/252 + # https://github.com/moby/buildkit/issues/1896 + - name: Move cache + run: | + rm -rf /tmp/.buildx-cache + mv /tmp/.buildx-cache-new /tmp/.buildx-cache - name: List docker images run: docker images @@ -297,8 +317,9 @@ jobs: uses: actions/cache@v3 with: path: /tmp/.buildx-cache - key: ${{ runner.os }}-buildx-${{ github.sha }} + key: ${{ runner.os }}-buildx-${{ env.VARIANT_TAG }}-${{ github.sha }} restore-keys: | + ${{ runner.os }}-buildx-${{ env.VARIANT_TAG }}- ${{ runner.os }}-buildx- - name: Prepare @@ -351,7 +372,7 @@ jobs: ${{ github.repository }}:${{ env.VARIANT_TAG_WITH_REF }} ${{ github.repository }}:${{ env.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max - name: Build and push (master) id: docker_build_master @@ -365,7 +386,8 @@ jobs: tags: | ${{ github.repository }}:${{ env.VARIANT_TAG_WITH_REF }} ${{ github.repository }}:${{ env.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} - cache-to: type=local,dest=/tmp/.buildx-cache + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max - name: Build and push (release) id: docker_build_release @@ -380,7 +402,15 @@ jobs: ${{ github.repository }}:${{ env.VARIANT_TAG_WITH_REF }} ${{ github.repository }}:${{ env.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max + + # Temp fix + # https://github.com/docker/build-push-action/issues/252 + # https://github.com/moby/buildkit/issues/1896 + - name: Move cache + run: | + rm -rf /tmp/.buildx-cache + mv /tmp/.buildx-cache-new /tmp/.buildx-cache - name: List docker images run: docker images @@ -423,8 +453,9 @@ jobs: uses: actions/cache@v3 with: path: /tmp/.buildx-cache - key: ${{ runner.os }}-buildx-${{ github.sha }} + key: ${{ runner.os }}-buildx-${{ env.VARIANT_TAG }}-${{ github.sha }} restore-keys: | + ${{ runner.os }}-buildx-${{ env.VARIANT_TAG }}- ${{ runner.os }}-buildx- - name: Prepare @@ -477,7 +508,7 @@ jobs: ${{ github.repository }}:${{ env.VARIANT_TAG_WITH_REF }} ${{ github.repository }}:${{ env.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max - name: Build and push (master) id: docker_build_master @@ -491,7 +522,8 @@ jobs: tags: | ${{ github.repository }}:${{ env.VARIANT_TAG_WITH_REF }} ${{ github.repository }}:${{ env.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} - cache-to: type=local,dest=/tmp/.buildx-cache + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max - name: Build and push (release) id: docker_build_release @@ -506,7 +538,15 @@ jobs: ${{ github.repository }}:${{ env.VARIANT_TAG_WITH_REF }} ${{ github.repository }}:${{ env.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max + + # Temp fix + # https://github.com/docker/build-push-action/issues/252 + # https://github.com/moby/buildkit/issues/1896 + - name: Move cache + run: | + rm -rf /tmp/.buildx-cache + mv /tmp/.buildx-cache-new /tmp/.buildx-cache - name: List docker images run: docker images @@ -549,8 +589,9 @@ jobs: uses: actions/cache@v3 with: path: /tmp/.buildx-cache - key: ${{ runner.os }}-buildx-${{ github.sha }} + key: ${{ runner.os }}-buildx-${{ env.VARIANT_TAG }}-${{ github.sha }} restore-keys: | + ${{ runner.os }}-buildx-${{ env.VARIANT_TAG }}- ${{ runner.os }}-buildx- - name: Prepare @@ -603,7 +644,7 @@ jobs: ${{ github.repository }}:${{ env.VARIANT_TAG_WITH_REF }} ${{ github.repository }}:${{ env.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max - name: Build and push (master) id: docker_build_master @@ -617,7 +658,8 @@ jobs: tags: | ${{ github.repository }}:${{ env.VARIANT_TAG_WITH_REF }} ${{ github.repository }}:${{ env.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} - cache-to: type=local,dest=/tmp/.buildx-cache + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max - name: Build and push (release) id: docker_build_release @@ -632,7 +674,15 @@ jobs: ${{ github.repository }}:${{ env.VARIANT_TAG_WITH_REF }} ${{ github.repository }}:${{ env.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max + + # Temp fix + # https://github.com/docker/build-push-action/issues/252 + # https://github.com/moby/buildkit/issues/1896 + - name: Move cache + run: | + rm -rf /tmp/.buildx-cache + mv /tmp/.buildx-cache-new /tmp/.buildx-cache - name: List docker images run: docker images @@ -675,8 +725,9 @@ jobs: uses: actions/cache@v3 with: path: /tmp/.buildx-cache - key: ${{ runner.os }}-buildx-${{ github.sha }} + key: ${{ runner.os }}-buildx-${{ env.VARIANT_TAG }}-${{ github.sha }} restore-keys: | + ${{ runner.os }}-buildx-${{ env.VARIANT_TAG }}- ${{ runner.os }}-buildx- - name: Prepare @@ -729,7 +780,7 @@ jobs: ${{ github.repository }}:${{ env.VARIANT_TAG_WITH_REF }} ${{ github.repository }}:${{ env.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max - name: Build and push (master) id: docker_build_master @@ -743,7 +794,8 @@ jobs: tags: | ${{ github.repository }}:${{ env.VARIANT_TAG_WITH_REF }} ${{ github.repository }}:${{ env.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} - cache-to: type=local,dest=/tmp/.buildx-cache + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max - name: Build and push (release) id: docker_build_release @@ -758,7 +810,15 @@ jobs: ${{ github.repository }}:${{ env.VARIANT_TAG_WITH_REF }} ${{ github.repository }}:${{ env.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max + + # Temp fix + # https://github.com/docker/build-push-action/issues/252 + # https://github.com/moby/buildkit/issues/1896 + - name: Move cache + run: | + rm -rf /tmp/.buildx-cache + mv /tmp/.buildx-cache-new /tmp/.buildx-cache - name: List docker images run: docker images @@ -801,8 +861,9 @@ jobs: uses: actions/cache@v3 with: path: /tmp/.buildx-cache - key: ${{ runner.os }}-buildx-${{ github.sha }} + key: ${{ runner.os }}-buildx-${{ env.VARIANT_TAG }}-${{ github.sha }} restore-keys: | + ${{ runner.os }}-buildx-${{ env.VARIANT_TAG }}- ${{ runner.os }}-buildx- - name: Prepare @@ -855,7 +916,7 @@ jobs: ${{ github.repository }}:${{ env.VARIANT_TAG_WITH_REF }} ${{ github.repository }}:${{ env.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max - name: Build and push (master) id: docker_build_master @@ -869,7 +930,8 @@ jobs: tags: | ${{ github.repository }}:${{ env.VARIANT_TAG_WITH_REF }} ${{ github.repository }}:${{ env.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} - cache-to: type=local,dest=/tmp/.buildx-cache + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max - name: Build and push (release) id: docker_build_release @@ -884,7 +946,15 @@ jobs: ${{ github.repository }}:${{ env.VARIANT_TAG_WITH_REF }} ${{ github.repository }}:${{ env.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max + + # Temp fix + # https://github.com/docker/build-push-action/issues/252 + # https://github.com/moby/buildkit/issues/1896 + - name: Move cache + run: | + rm -rf /tmp/.buildx-cache + mv /tmp/.buildx-cache-new /tmp/.buildx-cache - name: List docker images run: docker images @@ -927,8 +997,9 @@ jobs: uses: actions/cache@v3 with: path: /tmp/.buildx-cache - key: ${{ runner.os }}-buildx-${{ github.sha }} + key: ${{ runner.os }}-buildx-${{ env.VARIANT_TAG }}-${{ github.sha }} restore-keys: | + ${{ runner.os }}-buildx-${{ env.VARIANT_TAG }}- ${{ runner.os }}-buildx- - name: Prepare @@ -981,7 +1052,7 @@ jobs: ${{ github.repository }}:${{ env.VARIANT_TAG_WITH_REF }} ${{ github.repository }}:${{ env.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max - name: Build and push (master) id: docker_build_master @@ -995,7 +1066,8 @@ jobs: tags: | ${{ github.repository }}:${{ env.VARIANT_TAG_WITH_REF }} ${{ github.repository }}:${{ env.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} - cache-to: type=local,dest=/tmp/.buildx-cache + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max - name: Build and push (release) id: docker_build_release @@ -1010,7 +1082,15 @@ jobs: ${{ github.repository }}:${{ env.VARIANT_TAG_WITH_REF }} ${{ github.repository }}:${{ env.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max + + # Temp fix + # https://github.com/docker/build-push-action/issues/252 + # https://github.com/moby/buildkit/issues/1896 + - name: Move cache + run: | + rm -rf /tmp/.buildx-cache + mv /tmp/.buildx-cache-new /tmp/.buildx-cache - name: List docker images run: docker images @@ -1053,8 +1133,9 @@ jobs: uses: actions/cache@v3 with: path: /tmp/.buildx-cache - key: ${{ runner.os }}-buildx-${{ github.sha }} + key: ${{ runner.os }}-buildx-${{ env.VARIANT_TAG }}-${{ github.sha }} restore-keys: | + ${{ runner.os }}-buildx-${{ env.VARIANT_TAG }}- ${{ runner.os }}-buildx- - name: Prepare @@ -1107,7 +1188,7 @@ jobs: ${{ github.repository }}:${{ env.VARIANT_TAG_WITH_REF }} ${{ github.repository }}:${{ env.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max - name: Build and push (master) id: docker_build_master @@ -1121,7 +1202,8 @@ jobs: tags: | ${{ github.repository }}:${{ env.VARIANT_TAG_WITH_REF }} ${{ github.repository }}:${{ env.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} - cache-to: type=local,dest=/tmp/.buildx-cache + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max - name: Build and push (release) id: docker_build_release @@ -1136,7 +1218,15 @@ jobs: ${{ github.repository }}:${{ env.VARIANT_TAG_WITH_REF }} ${{ github.repository }}:${{ env.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max + + # Temp fix + # https://github.com/docker/build-push-action/issues/252 + # https://github.com/moby/buildkit/issues/1896 + - name: Move cache + run: | + rm -rf /tmp/.buildx-cache + mv /tmp/.buildx-cache-new /tmp/.buildx-cache - name: List docker images run: docker images @@ -1179,8 +1269,9 @@ jobs: uses: actions/cache@v3 with: path: /tmp/.buildx-cache - key: ${{ runner.os }}-buildx-${{ github.sha }} + key: ${{ runner.os }}-buildx-${{ env.VARIANT_TAG }}-${{ github.sha }} restore-keys: | + ${{ runner.os }}-buildx-${{ env.VARIANT_TAG }}- ${{ runner.os }}-buildx- - name: Prepare @@ -1233,7 +1324,7 @@ jobs: ${{ github.repository }}:${{ env.VARIANT_TAG_WITH_REF }} ${{ github.repository }}:${{ env.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max - name: Build and push (master) id: docker_build_master @@ -1247,7 +1338,8 @@ jobs: tags: | ${{ github.repository }}:${{ env.VARIANT_TAG_WITH_REF }} ${{ github.repository }}:${{ env.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} - cache-to: type=local,dest=/tmp/.buildx-cache + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max - name: Build and push (release) id: docker_build_release @@ -1262,7 +1354,15 @@ jobs: ${{ github.repository }}:${{ env.VARIANT_TAG_WITH_REF }} ${{ github.repository }}:${{ env.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max + + # Temp fix + # https://github.com/docker/build-push-action/issues/252 + # https://github.com/moby/buildkit/issues/1896 + - name: Move cache + run: | + rm -rf /tmp/.buildx-cache + mv /tmp/.buildx-cache-new /tmp/.buildx-cache - name: List docker images run: docker images @@ -1305,8 +1405,9 @@ jobs: uses: actions/cache@v3 with: path: /tmp/.buildx-cache - key: ${{ runner.os }}-buildx-${{ github.sha }} + key: ${{ runner.os }}-buildx-${{ env.VARIANT_TAG }}-${{ github.sha }} restore-keys: | + ${{ runner.os }}-buildx-${{ env.VARIANT_TAG }}- ${{ runner.os }}-buildx- - name: Prepare @@ -1359,7 +1460,7 @@ jobs: ${{ github.repository }}:${{ env.VARIANT_TAG_WITH_REF }} ${{ github.repository }}:${{ env.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max - name: Build and push (master) id: docker_build_master @@ -1373,7 +1474,8 @@ jobs: tags: | ${{ github.repository }}:${{ env.VARIANT_TAG_WITH_REF }} ${{ github.repository }}:${{ env.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} - cache-to: type=local,dest=/tmp/.buildx-cache + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max - name: Build and push (release) id: docker_build_release @@ -1388,7 +1490,15 @@ jobs: ${{ github.repository }}:${{ env.VARIANT_TAG_WITH_REF }} ${{ github.repository }}:${{ env.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max + + # Temp fix + # https://github.com/docker/build-push-action/issues/252 + # https://github.com/moby/buildkit/issues/1896 + - name: Move cache + run: | + rm -rf /tmp/.buildx-cache + mv /tmp/.buildx-cache-new /tmp/.buildx-cache - name: List docker images run: docker images @@ -1431,8 +1541,9 @@ jobs: uses: actions/cache@v3 with: path: /tmp/.buildx-cache - key: ${{ runner.os }}-buildx-${{ github.sha }} + key: ${{ runner.os }}-buildx-${{ env.VARIANT_TAG }}-${{ github.sha }} restore-keys: | + ${{ runner.os }}-buildx-${{ env.VARIANT_TAG }}- ${{ runner.os }}-buildx- - name: Prepare @@ -1485,7 +1596,7 @@ jobs: ${{ github.repository }}:${{ env.VARIANT_TAG_WITH_REF }} ${{ github.repository }}:${{ env.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max - name: Build and push (master) id: docker_build_master @@ -1499,7 +1610,8 @@ jobs: tags: | ${{ github.repository }}:${{ env.VARIANT_TAG_WITH_REF }} ${{ github.repository }}:${{ env.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} - cache-to: type=local,dest=/tmp/.buildx-cache + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max - name: Build and push (release) id: docker_build_release @@ -1515,7 +1627,15 @@ jobs: ${{ github.repository }}:${{ env.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} ${{ github.repository }}:latest cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max + + # Temp fix + # https://github.com/docker/build-push-action/issues/252 + # https://github.com/moby/buildkit/issues/1896 + - name: Move cache + run: | + rm -rf /tmp/.buildx-cache + mv /tmp/.buildx-cache-new /tmp/.buildx-cache - name: List docker images run: docker images @@ -1558,8 +1678,9 @@ jobs: uses: actions/cache@v3 with: path: /tmp/.buildx-cache - key: ${{ runner.os }}-buildx-${{ github.sha }} + key: ${{ runner.os }}-buildx-${{ env.VARIANT_TAG }}-${{ github.sha }} restore-keys: | + ${{ runner.os }}-buildx-${{ env.VARIANT_TAG }}- ${{ runner.os }}-buildx- - name: Prepare @@ -1612,7 +1733,7 @@ jobs: ${{ github.repository }}:${{ env.VARIANT_TAG_WITH_REF }} ${{ github.repository }}:${{ env.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max - name: Build and push (master) id: docker_build_master @@ -1626,7 +1747,8 @@ jobs: tags: | ${{ github.repository }}:${{ env.VARIANT_TAG_WITH_REF }} ${{ github.repository }}:${{ env.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} - cache-to: type=local,dest=/tmp/.buildx-cache + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max - name: Build and push (release) id: docker_build_release @@ -1641,7 +1763,15 @@ jobs: ${{ github.repository }}:${{ env.VARIANT_TAG_WITH_REF }} ${{ github.repository }}:${{ env.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max + + # Temp fix + # https://github.com/docker/build-push-action/issues/252 + # https://github.com/moby/buildkit/issues/1896 + - name: Move cache + run: | + rm -rf /tmp/.buildx-cache + mv /tmp/.buildx-cache-new /tmp/.buildx-cache - name: List docker images run: docker images @@ -1684,8 +1814,9 @@ jobs: uses: actions/cache@v3 with: path: /tmp/.buildx-cache - key: ${{ runner.os }}-buildx-${{ github.sha }} + key: ${{ runner.os }}-buildx-${{ env.VARIANT_TAG }}-${{ github.sha }} restore-keys: | + ${{ runner.os }}-buildx-${{ env.VARIANT_TAG }}- ${{ runner.os }}-buildx- - name: Prepare @@ -1738,7 +1869,7 @@ jobs: ${{ github.repository }}:${{ env.VARIANT_TAG_WITH_REF }} ${{ github.repository }}:${{ env.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max - name: Build and push (master) id: docker_build_master @@ -1752,7 +1883,8 @@ jobs: tags: | ${{ github.repository }}:${{ env.VARIANT_TAG_WITH_REF }} ${{ github.repository }}:${{ env.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} - cache-to: type=local,dest=/tmp/.buildx-cache + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max - name: Build and push (release) id: docker_build_release @@ -1767,7 +1899,15 @@ jobs: ${{ github.repository }}:${{ env.VARIANT_TAG_WITH_REF }} ${{ github.repository }}:${{ env.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max + + # Temp fix + # https://github.com/docker/build-push-action/issues/252 + # https://github.com/moby/buildkit/issues/1896 + - name: Move cache + run: | + rm -rf /tmp/.buildx-cache + mv /tmp/.buildx-cache-new /tmp/.buildx-cache - name: List docker images run: docker images @@ -1810,8 +1950,9 @@ jobs: uses: actions/cache@v3 with: path: /tmp/.buildx-cache - key: ${{ runner.os }}-buildx-${{ github.sha }} + key: ${{ runner.os }}-buildx-${{ env.VARIANT_TAG }}-${{ github.sha }} restore-keys: | + ${{ runner.os }}-buildx-${{ env.VARIANT_TAG }}- ${{ runner.os }}-buildx- - name: Prepare @@ -1864,7 +2005,7 @@ jobs: ${{ github.repository }}:${{ env.VARIANT_TAG_WITH_REF }} ${{ github.repository }}:${{ env.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max - name: Build and push (master) id: docker_build_master @@ -1878,7 +2019,8 @@ jobs: tags: | ${{ github.repository }}:${{ env.VARIANT_TAG_WITH_REF }} ${{ github.repository }}:${{ env.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} - cache-to: type=local,dest=/tmp/.buildx-cache + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max - name: Build and push (release) id: docker_build_release @@ -1893,7 +2035,15 @@ jobs: ${{ github.repository }}:${{ env.VARIANT_TAG_WITH_REF }} ${{ github.repository }}:${{ env.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max + + # Temp fix + # https://github.com/docker/build-push-action/issues/252 + # https://github.com/moby/buildkit/issues/1896 + - name: Move cache + run: | + rm -rf /tmp/.buildx-cache + mv /tmp/.buildx-cache-new /tmp/.buildx-cache - name: List docker images run: docker images @@ -1936,8 +2086,9 @@ jobs: uses: actions/cache@v3 with: path: /tmp/.buildx-cache - key: ${{ runner.os }}-buildx-${{ github.sha }} + key: ${{ runner.os }}-buildx-${{ env.VARIANT_TAG }}-${{ github.sha }} restore-keys: | + ${{ runner.os }}-buildx-${{ env.VARIANT_TAG }}- ${{ runner.os }}-buildx- - name: Prepare @@ -1990,7 +2141,7 @@ jobs: ${{ github.repository }}:${{ env.VARIANT_TAG_WITH_REF }} ${{ github.repository }}:${{ env.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max - name: Build and push (master) id: docker_build_master @@ -2004,7 +2155,8 @@ jobs: tags: | ${{ github.repository }}:${{ env.VARIANT_TAG_WITH_REF }} ${{ github.repository }}:${{ env.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} - cache-to: type=local,dest=/tmp/.buildx-cache + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max - name: Build and push (release) id: docker_build_release @@ -2019,7 +2171,15 @@ jobs: ${{ github.repository }}:${{ env.VARIANT_TAG_WITH_REF }} ${{ github.repository }}:${{ env.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max + + # Temp fix + # https://github.com/docker/build-push-action/issues/252 + # https://github.com/moby/buildkit/issues/1896 + - name: Move cache + run: | + rm -rf /tmp/.buildx-cache + mv /tmp/.buildx-cache-new /tmp/.buildx-cache - name: List docker images run: docker images @@ -2062,8 +2222,9 @@ jobs: uses: actions/cache@v3 with: path: /tmp/.buildx-cache - key: ${{ runner.os }}-buildx-${{ github.sha }} + key: ${{ runner.os }}-buildx-${{ env.VARIANT_TAG }}-${{ github.sha }} restore-keys: | + ${{ runner.os }}-buildx-${{ env.VARIANT_TAG }}- ${{ runner.os }}-buildx- - name: Prepare @@ -2116,7 +2277,7 @@ jobs: ${{ github.repository }}:${{ env.VARIANT_TAG_WITH_REF }} ${{ github.repository }}:${{ env.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max - name: Build and push (master) id: docker_build_master @@ -2130,7 +2291,8 @@ jobs: tags: | ${{ github.repository }}:${{ env.VARIANT_TAG_WITH_REF }} ${{ github.repository }}:${{ env.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} - cache-to: type=local,dest=/tmp/.buildx-cache + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max - name: Build and push (release) id: docker_build_release @@ -2145,7 +2307,15 @@ jobs: ${{ github.repository }}:${{ env.VARIANT_TAG_WITH_REF }} ${{ github.repository }}:${{ env.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max + + # Temp fix + # https://github.com/docker/build-push-action/issues/252 + # https://github.com/moby/buildkit/issues/1896 + - name: Move cache + run: | + rm -rf /tmp/.buildx-cache + mv /tmp/.buildx-cache-new /tmp/.buildx-cache - name: List docker images run: docker images @@ -2188,8 +2358,9 @@ jobs: uses: actions/cache@v3 with: path: /tmp/.buildx-cache - key: ${{ runner.os }}-buildx-${{ github.sha }} + key: ${{ runner.os }}-buildx-${{ env.VARIANT_TAG }}-${{ github.sha }} restore-keys: | + ${{ runner.os }}-buildx-${{ env.VARIANT_TAG }}- ${{ runner.os }}-buildx- - name: Prepare @@ -2242,7 +2413,7 @@ jobs: ${{ github.repository }}:${{ env.VARIANT_TAG_WITH_REF }} ${{ github.repository }}:${{ env.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max - name: Build and push (master) id: docker_build_master @@ -2256,7 +2427,8 @@ jobs: tags: | ${{ github.repository }}:${{ env.VARIANT_TAG_WITH_REF }} ${{ github.repository }}:${{ env.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} - cache-to: type=local,dest=/tmp/.buildx-cache + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max - name: Build and push (release) id: docker_build_release @@ -2271,7 +2443,15 @@ jobs: ${{ github.repository }}:${{ env.VARIANT_TAG_WITH_REF }} ${{ github.repository }}:${{ env.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max + + # Temp fix + # https://github.com/docker/build-push-action/issues/252 + # https://github.com/moby/buildkit/issues/1896 + - name: Move cache + run: | + rm -rf /tmp/.buildx-cache + mv /tmp/.buildx-cache-new /tmp/.buildx-cache - name: List docker images run: docker images @@ -2314,8 +2494,9 @@ jobs: uses: actions/cache@v3 with: path: /tmp/.buildx-cache - key: ${{ runner.os }}-buildx-${{ github.sha }} + key: ${{ runner.os }}-buildx-${{ env.VARIANT_TAG }}-${{ github.sha }} restore-keys: | + ${{ runner.os }}-buildx-${{ env.VARIANT_TAG }}- ${{ runner.os }}-buildx- - name: Prepare @@ -2368,7 +2549,7 @@ jobs: ${{ github.repository }}:${{ env.VARIANT_TAG_WITH_REF }} ${{ github.repository }}:${{ env.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max - name: Build and push (master) id: docker_build_master @@ -2382,7 +2563,8 @@ jobs: tags: | ${{ github.repository }}:${{ env.VARIANT_TAG_WITH_REF }} ${{ github.repository }}:${{ env.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} - cache-to: type=local,dest=/tmp/.buildx-cache + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max - name: Build and push (release) id: docker_build_release @@ -2397,7 +2579,15 @@ jobs: ${{ github.repository }}:${{ env.VARIANT_TAG_WITH_REF }} ${{ github.repository }}:${{ env.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max + + # Temp fix + # https://github.com/docker/build-push-action/issues/252 + # https://github.com/moby/buildkit/issues/1896 + - name: Move cache + run: | + rm -rf /tmp/.buildx-cache + mv /tmp/.buildx-cache-new /tmp/.buildx-cache - name: List docker images run: docker images @@ -2440,8 +2630,9 @@ jobs: uses: actions/cache@v3 with: path: /tmp/.buildx-cache - key: ${{ runner.os }}-buildx-${{ github.sha }} + key: ${{ runner.os }}-buildx-${{ env.VARIANT_TAG }}-${{ github.sha }} restore-keys: | + ${{ runner.os }}-buildx-${{ env.VARIANT_TAG }}- ${{ runner.os }}-buildx- - name: Prepare @@ -2494,7 +2685,7 @@ jobs: ${{ github.repository }}:${{ env.VARIANT_TAG_WITH_REF }} ${{ github.repository }}:${{ env.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max - name: Build and push (master) id: docker_build_master @@ -2508,7 +2699,8 @@ jobs: tags: | ${{ github.repository }}:${{ env.VARIANT_TAG_WITH_REF }} ${{ github.repository }}:${{ env.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} - cache-to: type=local,dest=/tmp/.buildx-cache + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max - name: Build and push (release) id: docker_build_release @@ -2523,7 +2715,15 @@ jobs: ${{ github.repository }}:${{ env.VARIANT_TAG_WITH_REF }} ${{ github.repository }}:${{ env.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max + + # Temp fix + # https://github.com/docker/build-push-action/issues/252 + # https://github.com/moby/buildkit/issues/1896 + - name: Move cache + run: | + rm -rf /tmp/.buildx-cache + mv /tmp/.buildx-cache-new /tmp/.buildx-cache - name: List docker images run: docker images @@ -2566,8 +2766,9 @@ jobs: uses: actions/cache@v3 with: path: /tmp/.buildx-cache - key: ${{ runner.os }}-buildx-${{ github.sha }} + key: ${{ runner.os }}-buildx-${{ env.VARIANT_TAG }}-${{ github.sha }} restore-keys: | + ${{ runner.os }}-buildx-${{ env.VARIANT_TAG }}- ${{ runner.os }}-buildx- - name: Prepare @@ -2620,7 +2821,7 @@ jobs: ${{ github.repository }}:${{ env.VARIANT_TAG_WITH_REF }} ${{ github.repository }}:${{ env.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max - name: Build and push (master) id: docker_build_master @@ -2634,7 +2835,8 @@ jobs: tags: | ${{ github.repository }}:${{ env.VARIANT_TAG_WITH_REF }} ${{ github.repository }}:${{ env.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} - cache-to: type=local,dest=/tmp/.buildx-cache + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max - name: Build and push (release) id: docker_build_release @@ -2649,7 +2851,15 @@ jobs: ${{ github.repository }}:${{ env.VARIANT_TAG_WITH_REF }} ${{ github.repository }}:${{ env.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max + + # Temp fix + # https://github.com/docker/build-push-action/issues/252 + # https://github.com/moby/buildkit/issues/1896 + - name: Move cache + run: | + rm -rf /tmp/.buildx-cache + mv /tmp/.buildx-cache-new /tmp/.buildx-cache - name: List docker images run: docker images @@ -2692,8 +2902,9 @@ jobs: uses: actions/cache@v3 with: path: /tmp/.buildx-cache - key: ${{ runner.os }}-buildx-${{ github.sha }} + key: ${{ runner.os }}-buildx-${{ env.VARIANT_TAG }}-${{ github.sha }} restore-keys: | + ${{ runner.os }}-buildx-${{ env.VARIANT_TAG }}- ${{ runner.os }}-buildx- - name: Prepare @@ -2746,7 +2957,7 @@ jobs: ${{ github.repository }}:${{ env.VARIANT_TAG_WITH_REF }} ${{ github.repository }}:${{ env.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max - name: Build and push (master) id: docker_build_master @@ -2760,7 +2971,8 @@ jobs: tags: | ${{ github.repository }}:${{ env.VARIANT_TAG_WITH_REF }} ${{ github.repository }}:${{ env.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} - cache-to: type=local,dest=/tmp/.buildx-cache + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max - name: Build and push (release) id: docker_build_release @@ -2775,7 +2987,15 @@ jobs: ${{ github.repository }}:${{ env.VARIANT_TAG_WITH_REF }} ${{ github.repository }}:${{ env.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max + + # Temp fix + # https://github.com/docker/build-push-action/issues/252 + # https://github.com/moby/buildkit/issues/1896 + - name: Move cache + run: | + rm -rf /tmp/.buildx-cache + mv /tmp/.buildx-cache-new /tmp/.buildx-cache - name: List docker images run: docker images diff --git a/generate/templates/.github/workflows/ci-master-pr.yml.ps1 b/generate/templates/.github/workflows/ci-master-pr.yml.ps1 index c949c3c..6d6cf19 100644 --- a/generate/templates/.github/workflows/ci-master-pr.yml.ps1 +++ b/generate/templates/.github/workflows/ci-master-pr.yml.ps1 @@ -55,8 +55,9 @@ $VARIANTS | % { uses: actions/cache@v3 with: path: /tmp/.buildx-cache - key: ${{ runner.os }}-buildx-${{ github.sha }} + key: ${{ runner.os }}-buildx-${{ env.VARIANT_TAG }}-${{ github.sha }} restore-keys: | + ${{ runner.os }}-buildx-${{ env.VARIANT_TAG }}- ${{ runner.os }}-buildx- - name: Prepare @@ -112,7 +113,7 @@ $VARIANTS | % { `${{ github.repository }}:`${{ env.VARIANT_TAG_WITH_REF }} `${{ github.repository }}:`${{ env.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max - name: Build and push (master) id: docker_build_master @@ -126,7 +127,8 @@ $VARIANTS | % { tags: | `${{ github.repository }}:`${{ env.VARIANT_TAG_WITH_REF }} `${{ github.repository }}:`${{ env.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} - cache-to: type=local,dest=/tmp/.buildx-cache + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max - name: Build and push (release) id: docker_build_release @@ -151,7 +153,15 @@ if ( $_['tag_as_latest'] ) { } @' cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max + + # Temp fix + # https://github.com/docker/build-push-action/issues/252 + # https://github.com/moby/buildkit/issues/1896 + - name: Move cache + run: | + rm -rf /tmp/.buildx-cache + mv /tmp/.buildx-cache-new /tmp/.buildx-cache - name: List docker images run: docker images