Fix buildx caching

This commit is contained in:
Ingo Oppermann
2024-02-21 11:15:29 +01:00
parent b5fad743b5
commit 3d81776720

View File

@@ -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 }}