Skip to content

Commit 2f9a92e

Browse files
authored
feat(ci): Update build.yml
1 parent ddc8b3b commit 2f9a92e

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

.github/workflows/build.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,3 +69,44 @@ jobs:
6969
target/
7070
key: ${{ steps.cache-restore.outputs.cache-primary-key }}
7171

72+
container:
73+
runs-on: ubuntu-latest
74+
permissions:
75+
contents: read
76+
env:
77+
REGISTRY: ghcr.io
78+
79+
steps:
80+
- name: "Checkout"
81+
uses: actions/checkout@v4
82+
83+
- name: Set up Docker Buildx
84+
uses: docker/setup-buildx-action@c47758b77c9736f4b2ef4073d4d51994fabfe349 # v3.7.1
85+
86+
- name: Set Container Metadata
87+
uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81
88+
id: meta
89+
with:
90+
images: ${{ env.REGISTRY }}/${{ github.repository }}
91+
tags: |
92+
# latest / main
93+
type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'main') }}
94+
95+
- name: Build Container ${{ github.repository }}
96+
uses: docker/build-push-action@4f58ea79222b3b9dc2c8bbdd6debcef730109a75 # v6.9.0
97+
id: build
98+
with:
99+
file: "./Dockerfile"
100+
context: .
101+
push: false
102+
tags: ${{ steps.meta.outputs.tags }}
103+
labels: ${{ steps.meta.outputs.labels }}
104+
# SBOM Settings
105+
sbom: true
106+
107+
# Upload Software Bill of Materials (SBOM) to GitHub
108+
- name: Upload SBOM
109+
uses: advanced-security/spdx-dependency-submission-action@5530bab9ee4bbe66420ce8280624036c77f89746 # v0.1.1
110+
with:
111+
filePath: '.'
112+
filePattern: '*.spdx.json'

0 commit comments

Comments
 (0)