chore(deps): update dependency @types/node to v22.12.0 #48
Workflow file for this run
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 and Scan Docker image | |
on: | |
push: | |
branches-ignore: | |
- gh-pages | |
tags: | |
- 'v[0-9]+.[0-9]+.[0-9]+' # trigger on tags with a semver | |
env: | |
REGISTRY: ghcr.io | |
IMAGE_NAME: ${{ github.repository }} | |
jobs: | |
build-and-publish: | |
name: Build | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Log in to the Container registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Extract metadata (tags, labels) for Docker | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | |
# The tag will be created by the publish.yml action | |
tags: | | |
type=raw,value=latest,enable={{is_default_branch}} | |
type=semver,pattern={{version}},enable=${{ startsWith(github.ref, 'refs/tags/') }} | |
type=semver,pattern={{major}}.{{minor}},enable=${{ startsWith(github.ref, 'refs/tags/') }} | |
type=semver,pattern={{major}},enable=${{ startsWith(github.ref, 'refs/tags/') }} | |
type=sha,format=long | |
- name: Build and push Docker image | |
id: build-and-push | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
push: 'true' | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
- name: Run Trivy vulnerability scanner | |
uses: aquasecurity/[email protected] | |
with: | |
image-ref: "${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}@${{ steps.build-and-push.outputs.digest }}" | |
output: trivy-report.json | |
format: json | |
exit-code: "0" | |
ignore-unfixed: true | |
vuln-type: "os,library" | |
severity: "CRITICAL" | |
- name: Upload Vulnerability Scan Results | |
uses: actions/upload-artifact@v4 | |
with: | |
name: trivy-report | |
path: trivy-report.json | |
retention-days: 30 | |
- name: Output artifact URL | |
run: echo 'Artifact URL is ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}/artifacts/${{ steps.artifact-upload-step.outputs.artifact-id }}' | |
- name: Get the JSON Report Download URL | |
id: get_report_url | |
run: | | |
repo_url="https://raw.githubusercontent.com/${{ github.repository }}/${{ github.ref_name }}/trivy-report.json" | |
echo "::set-output name=report_url::${repo_url}" | |
- name: Display Vulnerability Report URL | |
run: | | |
echo "You can view the vulnerability report here:" | |
echo "https://dbsystel.github.io/trivy-vulnerability-explorer/#/?url=${{ steps.get_report_url.outputs.report_url }}" |