Skip to content

Commit 54662ad

Browse files
committed
Use caching for Docker on GHA
1 parent 7a910cb commit 54662ad

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

.github/workflows/docker.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ jobs:
2828
env:
2929
DISABLE_ASSERTIONS: 1
3030
GITHUB_TOKEN: ${{ secrets.GH_PERSONAL_TOKEN }}
31+
- name: Set up Docker Buildx
32+
uses: docker/setup-buildx-action@v3
3133
- name: Log in to Docker Hub
3234
uses: docker/login-action@v3
3335
with:
@@ -44,14 +46,16 @@ jobs:
4446
type=semver,pattern={{major}}.{{minor}}
4547
# set latest tag for default branch
4648
type=raw,value=latest,enable={{is_default_branch}}
47-
- name: Build and push image
49+
- name: Build image
4850
uses: docker/build-push-action@v6
4951
with:
5052
context: ./target/docker/stage
5153
load: true
5254
tags: ${{ steps.meta.outputs.tags }}
5355
labels: ${{ steps.meta.outputs.labels }}
5456
push: false
57+
cache-from: type=gha
58+
cache-to: type=gha,mode=max
5559
- name: Test image
5660
env:
5761
DOCKER_TAG: ${{ steps.meta.outputs.tags }}
@@ -64,6 +68,8 @@ jobs:
6468
push: true
6569
tags: ${{ steps.meta.outputs.tags }}
6670
labels: ${{ steps.meta.outputs.labels }}
71+
cache-from: type=gha
72+
cache-to: type=gha,mode=max
6773
- name: Attest
6874
uses: actions/attest-build-provenance@v1
6975
id: attest

0 commit comments

Comments
 (0)