Skip to content

Commit

Permalink
Fix docker cache in github actions (#3918)
Browse files Browse the repository at this point in the history
If this [RoSys PR](zauberzeug/rosys#217) works,
we fix the Docker cache here as well by not confining the cache to a
commit.
  • Loading branch information
codingpaula authored Oct 25, 2024
1 parent 1e9a35b commit 79f6d76
Showing 1 changed file with 2 additions and 16 deletions.
18 changes: 2 additions & 16 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,6 @@ jobs:
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Cache Docker layers
uses: actions/cache@v4
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Build and push
uses: docker/build-push-action@v6
with:
Expand All @@ -93,15 +86,8 @@ jobs:
push: true
tags: ${{ steps.prep.outputs.tags }}
build-args: VERSION=${{ steps.prep.outputs.version }}
cache-from: type=local,src=/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
cache-from: type=registry,ref=${{ steps.prep.outputs.docker_image }}:buildcache
cache-to: type=registry,ref=${{ steps.prep.outputs.docker_image }}:buildcache,mode=max

# Uploading the README.md is not a core feature of docker/build-push-action yet
- name: Update README
Expand Down

0 comments on commit 79f6d76

Please sign in to comment.