From 2aecc80ccfe38d0b5b3ab94d160cdcad3f307c78 Mon Sep 17 00:00:00 2001 From: Leonard Jonathan Oh Date: Wed, 25 Jan 2023 04:05:11 +0000 Subject: [PATCH] Fix (ci): Fix caching for `docker buildx` --- .github/workflows/ci-master-pr.yml | 468 ++++++++++++++---- .../.github/workflows/ci-master-pr.yml.ps1 | 18 +- 2 files changed, 378 insertions(+), 108 deletions(-) diff --git a/.github/workflows/ci-master-pr.yml b/.github/workflows/ci-master-pr.yml index ad323b6..524a241 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 @@ -129,7 +131,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 @@ -172,8 +182,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 @@ -226,7 +237,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 @@ -240,7 +251,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 @@ -255,7 +267,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 @@ -298,8 +318,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 @@ -352,7 +373,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 @@ -366,7 +387,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 @@ -381,7 +403,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 @@ -424,8 +454,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 @@ -478,7 +509,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 @@ -492,7 +523,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 @@ -507,7 +539,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 @@ -550,8 +590,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 @@ -604,7 +645,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 @@ -618,7 +659,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 @@ -633,7 +675,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 @@ -676,8 +726,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 @@ -730,7 +781,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 @@ -744,7 +795,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 @@ -759,7 +811,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 @@ -802,8 +862,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 @@ -856,7 +917,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 @@ -870,7 +931,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 @@ -885,7 +947,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 @@ -928,8 +998,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 @@ -982,7 +1053,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 @@ -996,7 +1067,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 @@ -1011,7 +1083,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 @@ -1054,8 +1134,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 @@ -1108,7 +1189,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 @@ -1122,7 +1203,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 @@ -1137,7 +1219,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 @@ -1180,8 +1270,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 @@ -1234,7 +1325,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 @@ -1248,7 +1339,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 @@ -1263,7 +1355,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 @@ -1306,8 +1406,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 @@ -1360,7 +1461,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 @@ -1374,7 +1475,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 @@ -1389,7 +1491,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 @@ -1432,8 +1542,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 @@ -1486,7 +1597,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 @@ -1500,7 +1611,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 }} ${{ 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 @@ -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 @@ -2818,8 +3038,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 @@ -2872,7 +3093,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 @@ -2886,7 +3107,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 @@ -2901,7 +3123,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 @@ -2944,8 +3174,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 @@ -2998,7 +3229,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 @@ -3012,7 +3243,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 @@ -3027,7 +3259,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 @@ -3070,8 +3310,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 @@ -3124,7 +3365,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 @@ -3138,7 +3379,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 @@ -3153,7 +3395,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 @@ -3196,8 +3446,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 @@ -3250,7 +3501,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 @@ -3264,7 +3515,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 @@ -3279,7 +3531,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..0f2fb62 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