Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
text-generation-inference
Commits
9683c37b
Unverified
Commit
9683c37b
authored
Apr 13, 2023
by
OlivierDehaene
Committed by
GitHub
Apr 13, 2023
Browse files
feat(ci): add Trivy and scan docker image (#178)
parent
643a39d5
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
1 deletion
+22
-1
.github/workflows/build.yaml
.github/workflows/build.yaml
+22
-1
No files found.
.github/workflows/build.yaml
View file @
9683c37b
...
...
@@ -87,6 +87,7 @@ jobs:
type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', github.event.repository.default_branch) }}
type=raw,value=sha-${{ env.GITHUB_SHA_SHORT }}
-
name
:
Build and push Docker image
id
:
build-and-push
uses
:
docker/build-push-action@v4
with
:
context
:
.
...
...
@@ -97,7 +98,6 @@ jobs:
labels
:
${{ steps.meta.outputs.labels }}
cache-from
:
type=registry,ref=registry.internal.huggingface.tech/api-inference/community/text-generation-inference:cache,mode=max
cache-to
:
type=registry,ref=registry.internal.huggingface.tech/api-inference/community/text-generation-inference:cache,mode=max
# Sign the resulting Docker image digest except on PRs.
# This will only write to the public Rekor transparency log when the Docker
# repository is public to avoid leaking data.
...
...
@@ -108,6 +108,27 @@ jobs:
# This step uses the identity token to provision an ephemeral certificate
# against the sigstore community Fulcio instance.
run
:
echo "${{ steps.meta.outputs.tags }}" | xargs -I {} cosign sign {}@${{ steps.build-and-push.outputs.digest }}
-
name
:
Run Trivy in GitHub SBOM mode and submit results to Dependency Graph
uses
:
aquasecurity/trivy-action@master
if
:
${{ github.event_name != 'pull_request' }}
with
:
image-ref
:
'
ghcr.io/huggingface/text-generation-inference:sha-${{
env.GITHUB_SHA_SHORT
}}'
format
:
'
github'
output
:
'
dependency-results.sbom.json'
github-pat
:
${{ secrets.GITHUB_TOKEN }}
-
name
:
Run Trivy vulnerability scanner
uses
:
aquasecurity/trivy-action@master
if
:
${{ github.event_name != 'pull_request' }}
with
:
image-ref
:
'
ghcr.io/huggingface/text-generation-inference:sha-${{
env.GITHUB_SHA_SHORT
}}'
format
:
'
sarif'
output
:
'
trivy-results.sarif'
severity
:
'
CRITICAL'
-
name
:
Upload Trivy scan results to GitHub Security tab
uses
:
github/codeql-action/upload-sarif@v2
if
:
${{ github.event_name != 'pull_request' }}
with
:
sarif_file
:
'
trivy-results.sarif'
build-and-push-sagemaker-image
:
needs
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment