Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions .github/workflows/run-ci-cd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,31 @@ jobs:
push: true
tags: ${{ env.DOCKERHUB_USERNAME }}/owasp-nest-frontend:staging

scan-staging-images:
name: Scan Staging Images with Trivy
needs: build-docker-staging-images
runs-on: ubuntu-latest
steps:
- name: Login to Docker Hub
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772
with:
username: ${{ env.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Scan backend image
uses: aquasecurity/trivy-action@d643310aeb0d3c4d4d5385d1f078e9c5d1e4b595
with:
image-ref: ${{ env.DOCKERHUB_USERNAME }}/owasp-nest-backend:staging
exit-code: 1
severity: 'HIGH,CRITICAL'

- name: Scan frontend image
uses: aquasecurity/trivy-action@d643310aeb0d3c4d4d5385d1f078e9c5d1e4b595
with:
image-ref: ${{ env.DOCKERHUB_USERNAME }}/owasp-nest-frontend:staging
exit-code: 1
severity: 'HIGH,CRITICAL'

deploy-staging-nest:
name: Deploy Nest Staging
env:
Expand All @@ -240,6 +265,7 @@ jobs:
github.ref == 'refs/heads/main'
needs:
- build-docker-staging-images
- scan-staging-images
runs-on: ubuntu-latest
steps:
- name: Check out repository
Expand Down Expand Up @@ -371,6 +397,31 @@ jobs:
push: true
tags: ${{ env.DOCKERHUB_USERNAME }}/owasp-nest-frontend:production

scan-production-images:
name: Scan Production Images with Trivy
needs: build-docker-production-images
runs-on: ubuntu-latest
steps:
- name: Login to Docker Hub
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772
with:
username: ${{ env.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Scan backend image
uses: aquasecurity/trivy-action@d643310aeb0d3c4d4d5385d1f078e9c5d1e4b595
with:
image-ref: ${{ env.DOCKERHUB_USERNAME }}/owasp-nest-backend:production
exit-code: 1
severity: 'HIGH,CRITICAL'

- name: Scan frontend image
uses: aquasecurity/trivy-action@d643310aeb0d3c4d4d5385d1f078e9c5d1e4b595
with:
image-ref: ${{ env.DOCKERHUB_USERNAME }}/owasp-nest-frontend:production
exit-code: 1
severity: 'HIGH,CRITICAL'

deploy-production-nest:
name: Deploy Nest to Production
env:
Expand All @@ -383,6 +434,7 @@ jobs:
github.event.action == 'published'
needs:
- build-docker-production-images
- scan-production-images
runs-on: ubuntu-latest
steps:
- name: Check out repository
Expand Down