Skip to content

Commit 37fa7fd

Browse files
authored
Merge pull request #84 from wdarking/fix-npm-cache
ci: rotate buildx cache weekly so npm@latest actually refreshes
2 parents 2f85e65 + bf4f2ab commit 37fa7fd

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

.github/workflows/ci-cd.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,21 @@ jobs:
2121
- name: Set up Docker Buildx
2222
uses: docker/setup-buildx-action@v3
2323

24+
- name: Compute cache week
25+
id: cachekey
26+
run: echo "week=$(date -u +%Y-%V)" >> "$GITHUB_OUTPUT"
27+
2428
- name: Cache Docker layers
2529
uses: actions/cache@v4
2630
with:
2731
path: /tmp/.buildx-cache
28-
key: docker-buildx-${{ matrix.version }}-${{ github.sha }}
29-
restore-keys: docker-buildx-${{ matrix.version }}-
32+
key: docker-buildx-${{ matrix.version }}-${{ steps.cachekey.outputs.week }}-${{ github.sha }}
33+
restore-keys: docker-buildx-${{ matrix.version }}-${{ steps.cachekey.outputs.week }}-
3034

3135
- name: Build
3236
run: |
3337
docker buildx build \
38+
--pull \
3439
--cache-from type=local,src=/tmp/.buildx-cache/${{ matrix.version }} \
3540
--cache-to type=local,dest=/tmp/.buildx-cache/${{ matrix.version }} \
3641
--output type=docker \

0 commit comments

Comments
 (0)