3434 - name : Set up Docker Buildx
3535 uses : docker/setup-buildx-action@v3
3636 - name : Cache Docker layers
37+ id : docker-cache
3738 uses : actions/cache@v4
3839 with :
3940 path : /tmp/.buildx-cache
6263 platforms : linux/amd64,linux/arm64
6364 file : ${{ steps.dockerfile.outputs.DOCKERFILE }}
6465 tags : |
65- ghcr.io/librecodecoop/nextcloud-dev-${{ matrix.container }}
66+ ghcr.io/librecodecoop/nextcloud-dev-${{ matrix.container }}:${{ github.sha }}
6667 cache-from : type=local,src=/tmp/.buildx-cache
6768 cache-to : type=local,dest=/tmp/.buildx-cache-new
6869 - name : Push container image
@@ -74,12 +75,16 @@ jobs:
7475 platforms : linux/amd64,linux/arm64
7576 file : ${{ steps.dockerfile.outputs.DOCKERFILE }}
7677 tags : |
77- ghcr.io/librecodecoop/nextcloud-dev-${{ matrix.container }}
78+ ghcr.io/librecodecoop/nextcloud-dev-${{ matrix.container }}:${{ github.sha }}
7879 cache-from : type=local,src=/tmp/.buildx-cache
7980 cache-to : type=local,dest=/tmp/.buildx-cache-new
8081 - name : Move cache
8182 run : |
8283 rm -rf /tmp/.buildx-cache
8384 mv /tmp/.buildx-cache-new /tmp/.buildx-cache
84-
85-
85+ - name : Save Docker cache
86+ if : steps.docker-cache.outputs.cache-hit != 'true'
87+ uses : actions/cache@v4
88+ with :
89+ path : /tmp/.buildx-cache
90+ key : ${{ matrix.container }}-buildx-${{ github.sha }}
0 commit comments