Skip to content

Issue build command directly #10

Issue build command directly

Issue build command directly #10

name: Build the homework
on: [push]
jobs:
build:
name: Build image
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build
run: docker build --platform linux/amd64 -t my-new-image:latest ./src
- name: List Docker images
run: docker image ls
- name: Run Trivy vulnerability scanner
uses: aquasecurity/trivy-action@0.18.0
with:
image-ref: 'my-new-image:latest'
format: 'sarif'
output: 'trivy-results.sarif'
- name: Upload Trivy scan results to GitHub Security tab
uses: github/codeql-action/upload-sarif@v2
if: always()
with:
sarif_file: 'trivy-results.sarif'