Skip to content

Commit 62c2c9a

Browse files
committed
Add Generate and Sign SBOM Steps
1 parent 6d47d95 commit 62c2c9a

3 files changed

Lines changed: 3181 additions & 32 deletions

File tree

.github/workflows/hugo.yaml

Lines changed: 67 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ on:
55
push:
66
branches:
77
- main
8+
- update-workflow
89

910
workflow_dispatch:
1011

@@ -23,6 +24,9 @@ defaults:
2324
working-directory: ./marketing
2425

2526
jobs:
27+
# --------------------------------------------------
28+
# 1️⃣ Build
29+
# --------------------------------------------------
2630
build:
2731
runs-on: ubuntu-latest
2832
env:
@@ -99,10 +103,13 @@ jobs:
99103
path: ${{ runner.temp }}/hugo_cache
100104
key: ${{ steps.cache-restore.outputs.cache-primary-key }}
101105
- name: Upload artifact
102-
uses: actions/upload-pages-artifact@v3
106+
uses: actions/upload-pages-artifact@v4
103107
with:
108+
name: build-output
104109
path: ./marketing/public
105-
110+
# --------------------------------------------------
111+
# 2️⃣ Deploy
112+
# --------------------------------------------------
106113
deploy:
107114
environment:
108115
name: github-pages
@@ -113,3 +120,61 @@ jobs:
113120
- name: Deploy to GitHub Pages
114121
id: deployment
115122
uses: actions/deploy-pages@v4
123+
124+
# --------------------------------------------------
125+
# 3️⃣ Generate SBOM
126+
# --------------------------------------------------
127+
generate-sbom:
128+
name: 📦 Generate SBOM
129+
runs-on: ubuntu-latest
130+
needs: build
131+
132+
steps:
133+
- name: Checkout Repo
134+
uses: actions/checkout@v5
135+
136+
- name: Download Build Artifacts
137+
uses: actions/download-artifact@v6
138+
with:
139+
name: build-output
140+
path: ./marketing
141+
142+
- name: Generate CycloneDX SBOM
143+
run: npx @cyclonedx/cyclonedx-npm --output-format JSON --output-file shiftleftcyber.github.io.cdx.json
144+
145+
- name: Upload SBOM
146+
uses: actions/upload-artifact@v5
147+
with:
148+
name: generated-sbom
149+
path: ./marketing/shiftleftcyber.github.io.cdx.json
150+
151+
# --------------------------------------------------
152+
# 4️⃣ Sign SBOM
153+
# --------------------------------------------------
154+
sign-sbom:
155+
name: 🔏 Sign SBOM
156+
runs-on: ubuntu-latest
157+
needs: generate-sbom
158+
159+
steps:
160+
- name: Checkout Repo
161+
uses: actions/checkout@v5
162+
163+
- name: Download Generated SBOM
164+
uses: actions/download-artifact@v6
165+
with:
166+
name: generated-sbom
167+
168+
- name: Sign SBOM
169+
uses: shiftleftcyber/secure-sbom-action@v1.3.1
170+
with:
171+
sbom_file: shiftleftcyber.github.io.cdx.json
172+
secure_sbom_action: sign
173+
api_key: ${{ secrets.SECURE_SBOM_API_KEY }}
174+
key_id: ${{ secrets.SECURE_SBOM_KEYID }}
175+
176+
- name: Upload Signed SBOM
177+
uses: actions/upload-artifact@v5
178+
with:
179+
name: signed-sbom
180+
path: ./marketing/shiftleftcyber.github.io.cdx.signed.json

0 commit comments

Comments
 (0)