Skip to content

Commit dd71eee

Browse files
committed
add the sbom action
1 parent 2e59b63 commit dd71eee

File tree

1 file changed

+33
-28
lines changed

1 file changed

+33
-28
lines changed

.github/workflows/publish_container.yaml

Lines changed: 33 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ name: Create and publish a Docker image
44
# Configures this workflow to run every time a change is pushed to the branch called `release`.
55
on:
66
push:
7-
branches: ['master']
7+
branches: ["master"]
88
workflow_dispatch:
99

1010
# Defines two custom environment variables for the workflow. These are used for the Container registry domain, and a name for the Docker image that this workflow builds.
@@ -70,35 +70,40 @@ jobs:
7070
annotations: ${{ steps.meta.outputs.annotations }}
7171
cache-from: type=gha
7272
cache-to: type=gha,mode=max
73+
- name: Generate SBOM for the dev Docker image
74+
uses: anchore/sbom-action@v0
75+
with:
76+
image: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-development:${{ steps.meta2.outputs.tags }}
77+
output-file: sbom-image-latest.json
7378
- name: Attest image
7479
uses: github-early-access/generate-build-provenance@main
7580
with:
7681
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
7782
subject-digest: ${{ steps.build-push-latest.outputs.digest }}
78-
- name: Extract metadata (tags, labels) for dev image
79-
id: meta2
80-
uses: docker/metadata-action@v5
81-
with:
82-
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-development
83-
flavor: |
84-
latest=true
85-
tags: |
86-
type=ref,event=branch
87-
type=sha,format=long
88-
- name: Build and push dev image
89-
id: build-push-development
90-
uses: docker/build-push-action@v5
91-
with:
92-
context: .
93-
push: true
94-
target: development
95-
tags: ${{ steps.meta2.outputs.tags }}
96-
labels: ${{ steps.meta2.outputs.labels }}
97-
annotations: ${{ steps.meta2.outputs.annotations }}
98-
cache-from: type=gha
99-
cache-to: type=gha,mode=max
100-
- name: Attest dev image
101-
uses: github-early-access/generate-build-provenance@main
102-
with:
103-
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-development
104-
subject-digest: ${{ steps.build-push-development.outputs.digest }}
83+
# - name: Extract metadata (tags, labels) for dev image
84+
# id: meta2
85+
# uses: docker/metadata-action@v5
86+
# with:
87+
# images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-development
88+
# flavor: |
89+
# latest=true
90+
# tags: |
91+
# type=ref,event=branch
92+
# type=sha,format=long
93+
# - name: Build and push dev image
94+
# id: build-push-development
95+
# uses: docker/build-push-action@v5
96+
# with:
97+
# context: .
98+
# push: true
99+
# target: development
100+
# tags: ${{ steps.meta2.outputs.tags }}
101+
# labels: ${{ steps.meta2.outputs.labels }}
102+
# annotations: ${{ steps.meta2.outputs.annotations }}
103+
# cache-from: type=gha
104+
# cache-to: type=gha,mode=max
105+
# - name: Attest dev image
106+
# uses: github-early-access/generate-build-provenance@main
107+
# with:
108+
# subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-development
109+
# subject-digest: ${{ steps.build-push-development.outputs.digest }}

0 commit comments

Comments
 (0)