Skip to content

Commit ab318a8

Browse files
authored
Merge pull request #6 from mook-as/ci/cache-save-on-main
CI: Only save cache on main
2 parents 22520de + 2e40098 commit ab318a8

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

.github/workflows/build.yaml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ jobs:
4040
buildkitd-flags: "--allow-insecure-entitlement security.insecure"
4141
platforms: linux/${{ matrix.arch }}
4242

43-
- name: Set up Docker layer cache
44-
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
43+
- name: Restore Docker layer cache
44+
uses: actions/cache/restore@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
4545
with:
4646
path: ${{ runner.temp }}/cache
4747
key: ${{ runner.arch }}-buildx-${{ matrix.type }}-${{ github.sha }}
@@ -62,3 +62,10 @@ jobs:
6262
with:
6363
name: distro-${{ matrix.type }}-${{ matrix.arch }}
6464
path: distro.${{ matrix.type }}
65+
66+
- name: Save Docker layer cache
67+
if: github.ref == 'refs/heads/main'
68+
uses: actions/cache/save@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
69+
with:
70+
path: ${{ runner.temp }}/cache
71+
key: ${{ runner.arch }}-buildx-${{ matrix.type }}-${{ github.sha }}

0 commit comments

Comments
 (0)