Skip to content

Commit

Permalink
Merge pull request #22 from depot/sbom-examples
Browse files Browse the repository at this point in the history
Add sbom example with upload artifact
  • Loading branch information
kylegalbraith committed Oct 8, 2023
2 parents fe21fca + 32924da commit 6246e3c
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,7 @@ jobs:
- [Build and push to multiple registries](/docs/build-and-push-multiple.md)
- [Export image to Docker](/docs/export-to-docker.md)
- [Lint and Build image](/docs/lint-and-build.md)
- [Build image with Software Bill of Materials (SBOM)](/docs/build-with-sbom.md)

## License

Expand Down
35 changes: 35 additions & 0 deletions docs/build-with-sbom.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
```yaml
name: Buid image with SBOM

on:
push:
branches:
- main

jobs:
docker-image:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- name: Checkout repo
uses: actions/checkout@v3

- name: Set up Depot CLI
uses: depot/setup-action@v1

- name: Build image with Software Bill of Materials (SBOM)
uses: depot/build-push-action@v1
with:
# if no depot.json file is at the root of your repo, you must specify the project id
project: <your-depot-project-id>
sbom: true
sbom-dir: ./sbom-output

- name: upload SBOM directory as a build artifact
uses: actions/upload-artifact@v3.1.0
with:
path: ./sbom-output
name: "SBOM"
```

0 comments on commit 6246e3c

Please sign in to comment.