Skip to content

Commit

Permalink
[PLAY-445] Add trivy scans (#287)
Browse files Browse the repository at this point in the history
Add trivy scans as part of CI/CD
  • Loading branch information
koncar authored Nov 15, 2023
1 parent cfbb772 commit 2eef34a
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 4 deletions.
34 changes: 31 additions & 3 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
name: deploy

on: push
on:
push:
tags:
- "*"
branches:
- "*"
schedule:
- cron: "0 0 * * 1"

jobs:
build:
Expand Down Expand Up @@ -102,13 +109,34 @@ jobs:
run: |
cli_tests/job.sh
cli_tests/app.sh
- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to Docker Hub
uses: docker/login-action@v1
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Push to Docker Hub
uses: docker/build-push-action@v2
with:
tags: shipasoftware/ketch:${{github.sha}}
push: true
push: true

- name: Run Trivy vulnerability scanner
uses: aquasecurity/trivy-action@f78e9ecf42a1271402d4f484518b9313235990e1
with:
image-ref: shipasoftware/ketch:${{ github.sha }}
format: "sarif"
output: "trivy-results.sarif"
exit-code: "1"

- name: Upload Trivy scan results to GitHub Security tab
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: "trivy-results.sarif"
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,4 @@ jobs:
file: bin/*
tag: ${{ github.ref }}
overwrite: true
file_glob: true
file_glob: true

0 comments on commit 2eef34a

Please sign in to comment.