Skip to content
This repository was archived by the owner on Oct 18, 2023. It is now read-only.

Commit 38a60b4

Browse files
author
Athos Couto
committed
Use registry as cache for Docker layers
This will allow the container build to reutilize layers between executions and effectively make cargo-chef work.
1 parent 295a097 commit 38a60b4

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

.github/workflows/pr-images.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ jobs:
2222
with:
2323
submodules: recursive
2424

25+
- name: Set up Docker Buildx
26+
uses: docker/setup-buildx-action@v3
27+
2528
- name: Log in to the Container registry
2629
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
2730
with:
@@ -42,3 +45,6 @@ jobs:
4245
push: true
4346
tags: ${{ steps.meta.outputs.tags }}-${{ github.event.pull_request.head.sha }}
4447
labels: ${{ steps.meta.outputs.labels }}
48+
cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:buildcache
49+
cache-to: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:buildcache,mode=max
50+

.github/workflows/publish.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ jobs:
2424
with:
2525
submodules: recursive
2626

27+
- name: Set up Docker Buildx
28+
uses: docker/setup-buildx-action@v3
29+
2730
- name: Log in to the Container registry
2831
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
2932
with:
@@ -44,3 +47,5 @@ jobs:
4447
push: true
4548
tags: ${{ steps.meta.outputs.tags }}
4649
labels: ${{ steps.meta.outputs.labels }}
50+
cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:buildcache
51+
cache-to: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:buildcache,mode=max

0 commit comments

Comments
 (0)