From 3d8177672038e91bf43cfe9e9007629b7780ce06 Mon Sep 17 00:00:00 2001 From: Ingo Oppermann Date: Wed, 21 Feb 2024 11:15:29 +0100 Subject: [PATCH] Fix buildx caching --- .github/workflows/build_base_matrix_vod.yaml | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build_base_matrix_vod.yaml b/.github/workflows/build_base_matrix_vod.yaml index caa40893..a37579cb 100644 --- a/.github/workflows/build_base_matrix_vod.yaml +++ b/.github/workflows/build_base_matrix_vod.yaml @@ -7,6 +7,9 @@ on: branches: - vod +env: + cachedir: /tmp/.buildx-cache-core-vod + jobs: docker: runs-on: [self-hosted] @@ -51,7 +54,7 @@ jobs: - name: Cache Docker layers uses: actions/cache@v4 with: - path: /tmp/.buildx-cache + path: ${{ env.cachedir }} key: ${{ runner.os }}-buildx-${{ github.sha }} restore-keys: | ${{ runner.os }}-buildx- @@ -76,5 +79,12 @@ jobs: push: true tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} - cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache-new + cache-from: type=local,src=${{ env.cachedir }} + cache-to: type=local,dest=${{ env.cachedir }}-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 ${{ env.cachedir }} + mv ${{ env.cachedir }}-new ${{ env.cachedir }}