Issue build command directly #10
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' |