File tree Expand file tree Collapse file tree 2 files changed +35
-1
lines changed Expand file tree Collapse file tree 2 files changed +35
-1
lines changed Original file line number Diff line number Diff line change 1+ name : Build & Trivy Scan
2+ on :
3+ push :
4+ branches :
5+ - main
6+ pull_request :
7+ branches :
8+ - main
9+
10+ jobs :
11+ build-and-scan :
12+ runs-on : ubuntu-latest
13+ env :
14+ DOCKER_HUB_USERNAME : ${{ secrets.DOCKER_HUB_USERNAME }}
15+ steps :
16+ - name : Checkout code
17+ uses : actions/checkout@v4
18+
19+ - name : Set up Docker Buildx
20+ uses : docker/setup-buildx-action@v3
21+
22+ - name : Build image
23+ run : |
24+ docker build -t "${DOCKER_HUB_USERNAME}/ceramicraft-user-mservice:${{ github.sha }}" server/
25+
26+ # scan and block if high severity vulnerabilities found
27+ - name : Run Trivy vulnerability scanner
28+ uses : aquasecurity/trivy-action@master
29+ with :
30+ image-ref : " ${{ env.DOCKER_HUB_USERNAME }}/ceramicraft-user-mservice:${{ github.sha }}"
31+ format : ' table'
32+ severity : ' CRITICAL,HIGH'
33+ exit-code : ' 1' # non zero exit code if vulnerabilities found
34+ ignore-unfixed : true # ingnore unfixed vulnerabilities
Original file line number Diff line number Diff line change 11# Use the official Go image with version 1.24
2- FROM golang:1.24.0 -alpine AS builder
2+ FROM golang:1.24.4 -alpine AS builder
33
44# Set the working directory inside the container
55WORKDIR /app
You can’t perform that action at this time.
0 commit comments