Skip to content

Commit 325fb1e

Browse files
authored
Merge pull request #5 from MuseIT-project/fix/sbom
Fix/SBOM
2 parents 206e893 + 6e0316c commit 325fb1e

1 file changed

Lines changed: 15 additions & 32 deletions

File tree

.github/workflows/docker-image.yml

Lines changed: 15 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Build and Deploy to RKE2
22

33
on:
44
push:
5-
branches: [ "master" ]
5+
branches: [ "master", 'fix/sbom' ]
66

77
jobs:
88
build:
@@ -17,25 +17,13 @@ jobs:
1717
username: ${{ secrets.HARBOR_USERNAME }}
1818
password: ${{ secrets.HARBOR_PASSWORD }}
1919

20-
- name: Create Python SBOM
21-
run: |
22-
python -m pip install --upgrade pip
23-
pip install cyclonedx-bom
24-
pip install -r requirements.txt
25-
cyclonedx-bom -r requirements.txt -o sbom-python.xml
26-
27-
- name: Install cosign
28-
run: |
29-
curl -sSfL https://github.com/sigstore/cosign/releases/latest/download/cosign-linux-amd64 \
30-
-o cosign
31-
chmod +x cosign
32-
sudo mv cosign /usr/local/bin/
20+
- name: Install Cosign
21+
uses: sigstore/cosign-installer@v3.9.2
3322

3423
- name: Install oras
35-
run: |
36-
curl -sSfL https://github.com/oras-project/oras/releases/latest/download/oras_1.1.0_linux_amd64.tar.gz \
37-
| tar -xz
38-
sudo mv oras /usr/local/bin/
24+
uses: oras-project/setup-oras@v1
25+
with:
26+
version: 1.2.3
3927

4028
- name: Build and Push Docker image
4129
run: |
@@ -44,23 +32,18 @@ jobs:
4432
docker push harbor.wizardtower.dev/museit/museit-docs:latest
4533
docker push harbor.wizardtower.dev/museit/museit-docs:$GITHUB_SHA
4634
47-
- name: Push SBOM to Harbor
48-
run: |
49-
oras push harbor.wizardtower.dev/museit/museit-docs/sbom:latest \
50-
--manifest-config sbom-python.xml:application/xml \
51-
sbom-python.xml:application/xml
52-
oras push harbor.wizardtower.dev/museit/museit-docs/sbom:$GITHUB_SHA \
53-
--manifest-config sbom-python.xml:application/xml \
54-
sbom-python.xml:application/xml
55-
56-
- name: Sign SBOM with Cosign
35+
- name: Sign images with Cosign
5736
env:
58-
COSIGN_PASSWORD: ${{ secrets.COSIGN_PASSWORD }}
37+
COSIGN_PRIVATE_KEY: ${{ secrets.COSIGN_PRIVATE_KEY }}
5938
run: |
60-
echo "${{ secrets.COSIGN_PRIVATE_KEY }}" > cosign.key
6139
cosign sign \
62-
--key cosign.key \
63-
harbor.wizardtower.dev/museit/museit-docs/sbom:$GITHUB_SHA
40+
--yes \
41+
--key env://COSIGN_PRIVATE_KEY \
42+
harbor.wizardtower.dev/museit/museit-docs:latest
43+
cosign sign \
44+
--yes \
45+
--key env://COSIGN_PRIVATE_KEY \
46+
harbor.wizardtower.dev/museit/museit-docs:$GITHUB_SHA
6447
6548
deploy:
6649
runs-on: [ self-hosted, linux, rke2, wizardtower ]

0 commit comments

Comments
 (0)