-
Notifications
You must be signed in to change notification settings - Fork 26
96 lines (73 loc) · 2.4 KB
/
build-and-publish-page.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
name: Node.js CI
on:
release:
types: [published]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js LTS
uses: actions/setup-node@v4
with:
node-version: 'lts/*'
# Build main page for the wiki
- name: Install dependencies
run: cd SBOM-wiki && npm install
- name: Run build
run: cd SBOM-wiki && npm run build
# Build the SBOM Catalog and copy the artifact to the wiki
- name: Install dependencies
run: cd SBOM-Catalog && npm install
- name: Run lint
run: cd SBOM-Catalog && npm run lint
- name: Run build
run: cd SBOM-Catalog && npm run build
- name: copy Catalog to build artifact
run: rm -rf SBOM-wiki/.vitepress/dist/catalog/* && mv SBOM-Catalog/dist/* SBOM-wiki/.vitepress/dist/catalog
# Publish all aritifacts
- name: Upload pages artifact to action workflow
uses: actions/upload-artifact@v4
with:
name: pages-build-artifact
path: SBOM-wiki/.vitepress/dist/
- name: Create zip for release file
run: zip -r sbom-catalog-${{github.ref_name}}.zip SBOM-wiki/.vitepress/dist
- name: Upload pages release asset
uses: softprops/action-gh-release@v2
with:
files: sbom-catalog-${{github.ref_name}}.zip
- name: Deploy
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: SBOM-wiki/.vitepress/dist
branch: gh-pages
# Create a SBOM with Syft for SPDX
create_spdx_sbom:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js LTS
uses: actions/setup-node@v4
with:
node-version: 'lts/*'
- name: Syft SPDX SBOM generation
uses: anchore/sbom-action@v0
with:
artifact-name: sbom-catalog-${{github.ref_name}}.spdx.json
format: spdx-json
# Create a SBOM with Syft for CycloneDX
create_cdx_sbom:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js LTS
uses: actions/setup-node@v4
with:
node-version: 'lts/*'
- name: Syft CycloneDx SBOM generation
uses: anchore/sbom-action@v0
with:
artifact-name: sbom-catalog-${{github.ref_name}}.cdx.json
format: cyclonedx-json