Skip to content

Commit d0c35e6

Browse files
committed
chore(docker): enable sbom and cache
Update the Docker publishing Action to enable SBOM and provenance attestations to the published images, as well as enabling caching of layers across runs.
1 parent 3ab8e94 commit d0c35e6

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

.github/workflows/docker.yaml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,30 @@ jobs:
2121
with:
2222
username: ${{ secrets.DOCKER_HUB_USERNAME }}
2323
password: ${{ secrets.DOCKER_HUB_TOKEN }}
24+
- uses: actions/cache@v4
25+
id: cache
26+
with:
27+
path: |
28+
go-pkg-mod
29+
root-cache-go-build
30+
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
31+
restore-keys: |
32+
${{ runner.os }}-go-
33+
- uses: reproducible-containers/buildkit-cache-dance@v3
34+
with:
35+
cache-map: |
36+
{
37+
"go-pkg-mod": "/go/pkg/mod",
38+
"root-cache-go-build": "/root/.cache/go-build",
39+
}
40+
skip-extraction: ${{ steps.cache.outputs.cache-hit }}
2441
- uses: docker/build-push-action@v5
2542
with:
2643
file: ./cmd/controller/Dockerfile
2744
platforms: linux/amd64, linux/arm64
45+
sbom: true
2846
tags: ${{ steps.docker-meta.outputs.tags }}
47+
labels: ${{ steps.docker-meta.outputs.labels }}
2948
push: ${{ startsWith(github.ref, 'refs/tags/v') }}
49+
cache-from: type=gha
50+
cache-to: type=gha,mode=max

0 commit comments

Comments
 (0)