Skip to content

Commit aeeed8f

Browse files
roujaAntoLC
authored andcommitted
✨(ci) add security scan
Add a security scan for CVE with trivy
1 parent 1e89eb1 commit aeeed8f

1 file changed

Lines changed: 22 additions & 3 deletions

File tree

.github/workflows/docker-hub.yml

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
name: Docker Hub Workflow
2+
run-name: Docker Hub Workflow
23

34
on:
45
workflow_dispatch:
@@ -48,9 +49,15 @@ jobs:
4849
name: Login to DockerHub
4950
if: github.event_name != 'pull_request'
5051
run: echo "$DOCKER_HUB_PASSWORD" | docker login -u "$DOCKER_HUB_USER" --password-stdin
52+
-
53+
name: Run trivy scan
54+
uses: numerique-gouv/action-trivy-cache@main
55+
with:
56+
docker-build-args: '--target backend-production -f Dockerfile'
57+
docker-image-name: 'docker.io/lasuite/impress-backend:${{ github.sha }}'
5158
-
5259
name: Build and push
53-
uses: docker/build-push-action@v5
60+
uses: docker/build-push-action@v6
5461
with:
5562
context: .
5663
target: backend-production
@@ -92,9 +99,15 @@ jobs:
9299
name: Login to DockerHub
93100
if: github.event_name != 'pull_request'
94101
run: echo "$DOCKER_HUB_PASSWORD" | docker login -u "$DOCKER_HUB_USER" --password-stdin
102+
-
103+
name: Run trivy scan
104+
uses: numerique-gouv/action-trivy-cache@main
105+
with:
106+
docker-build-args: '-f src/frontend/Dockerfile --target frontend-production'
107+
docker-image-name: 'docker.io/lasuite/impress-frontend:${{ github.sha }}'
95108
-
96109
name: Build and push
97-
uses: docker/build-push-action@v5
110+
uses: docker/build-push-action@v6
98111
with:
99112
context: .
100113
file: ./src/frontend/Dockerfile
@@ -137,9 +150,15 @@ jobs:
137150
name: Login to DockerHub
138151
if: github.event_name != 'pull_request'
139152
run: echo "$DOCKER_HUB_PASSWORD" | docker login -u "$DOCKER_HUB_USER" --password-stdin
153+
-
154+
name: Run trivy scan
155+
uses: numerique-gouv/action-trivy-cache@main
156+
with:
157+
docker-build-args: '-f src/frontend/Dockerfile --target y-provider'
158+
docker-image-name: 'docker.io/lasuite/impress-frontend:${{ github.sha }}'
140159
-
141160
name: Build and push
142-
uses: docker/build-push-action@v5
161+
uses: docker/build-push-action@v6
143162
with:
144163
context: .
145164
file: ./src/frontend/Dockerfile

0 commit comments

Comments
 (0)