Skip to content

Commit 153f186

Browse files
committed
Use workaround for Github Actions Docker cache
1 parent 59f2861 commit 153f186

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

.github/workflows/image_release.yml

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,15 @@ jobs:
6565
echo "PLATFORMS=linux/amd64,linux/arm64/v8" >> $GITHUB_ENV
6666
fi
6767
68+
# https://docs.docker.com/build/ci/github-actions/cache/#local-cache
69+
- name: Cache Docker layers
70+
uses: actions/cache@v5
71+
with:
72+
path: ${{ runner.temp }}/.buildx-cache
73+
key: ${{ runner.os }}-buildx-${{ hashFiles('docker/Dockerfile', 'pyproject.toml', 'uv.lock') }}
74+
restore-keys: |
75+
${{ runner.os }}-buildx-
76+
6877
- name: Build Backend Image
6978
uses: docker/build-push-action@v6
7079
with:
@@ -74,12 +83,20 @@ jobs:
7483
labels: ${{ steps.meta.outputs.labels }}
7584
pull: true
7685
push: true
77-
cache-to: type=gha,mode=max
78-
cache-from: type=gha
86+
cache-from: type=local,src=${{ runner.temp }}/.buildx-cache
87+
cache-to: type=local,dest=${{ runner.temp }}/.buildx-cache-new,mode=max,compression=zstd,compression-level=3
7988
platforms: ${{ env.PLATFORMS }}
8089
provenance: mode=max
8190
sbom: true
8291

92+
# Temp fix
93+
# https://github.com/docker/build-push-action/issues/252
94+
# https://github.com/moby/buildkit/issues/1896
95+
- name: Move cache
96+
run: |
97+
rm -rf ${{ runner.temp }}/.buildx-cache
98+
mv ${{ runner.temp }}/.buildx-cache-new ${{ runner.temp }}/.buildx-cache
99+
83100
- name: Convert README to Markdown
84101
uses: docker://pandoc/core:2.9
85102
with:

0 commit comments

Comments
 (0)