Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3 to 4.37.4. - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/v3...v4.37.4) --- updated-dependencies: - dependency-name: github/codeql-action dependency-version: 4.37.4 dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com>
87 lines
2.2 KiB
YAML
87 lines
2.2 KiB
YAML
name: Build and Push Nuncio Website Container
|
|
|
|
on:
|
|
push:
|
|
branches: [ main ]
|
|
pull_request:
|
|
branches: [ main ]
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: read
|
|
packages: write
|
|
steps:
|
|
- name: Checkout Code
|
|
uses: actions/checkout@v7
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v4
|
|
|
|
- name: Log in to GitHub Container Registry
|
|
if: github.event_name != 'pull_request'
|
|
uses: docker/login-action@v4
|
|
with:
|
|
registry: ghcr.io
|
|
username: ${{ github.actor }}
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Build and Push Docker Image
|
|
uses: docker/build-push-action@v7
|
|
with:
|
|
context: .
|
|
push: ${{ github.event_name != 'pull_request' }}
|
|
tags: |
|
|
ghcr.io/koftwentytwo/nuncio-website:latest
|
|
ghcr.io/koftwentytwo/nuncio-website:${{ github.sha }}
|
|
cache-from: type=gha
|
|
cache-to: type=gha,mode=max
|
|
|
|
trivy-scan:
|
|
needs: build
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: read
|
|
security-events: write
|
|
steps:
|
|
- name: Checkout Code
|
|
uses: actions/checkout@v7
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v4
|
|
|
|
- name: Build image for scanning
|
|
uses: docker/build-push-action@v7
|
|
with:
|
|
context: .
|
|
push: false
|
|
load: true
|
|
tags: nuncio-website:scan
|
|
cache-from: type=gha
|
|
|
|
- name: Run Trivy vulnerability scan (report-only, SARIF)
|
|
uses: aquasecurity/trivy-action@v0.36.0
|
|
with:
|
|
image-ref: nuncio-website:scan
|
|
format: sarif
|
|
output: trivy-results.sarif
|
|
severity: CRITICAL,HIGH
|
|
exit-code: '0'
|
|
|
|
- name: Upload Trivy results to GitHub code scanning
|
|
uses: github/codeql-action/upload-sarif@v4.37.4
|
|
with:
|
|
sarif_file: trivy-results.sarif
|
|
|
|
- name: Run Trivy vulnerability scan (blocking on CRITICAL)
|
|
uses: aquasecurity/trivy-action@v0.36.0
|
|
with:
|
|
image-ref: nuncio-website:scan
|
|
format: table
|
|
severity: CRITICAL
|
|
exit-code: '1'
|