Skip to content

Commit cd820dd

Browse files
committed
chore: save cache
Signed-off-by: Vitor Mattos <[email protected]>
1 parent ce0f3e1 commit cd820dd

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

.github/workflows/docker-php.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ jobs:
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
@@ -62,7 +63,7 @@ jobs:
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

Comments
 (0)