42
.github/workflows/make.yaml
vendored
42
.github/workflows/make.yaml
vendored
@@ -3,48 +3,62 @@ on:
|
|||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- "main"
|
- "main"
|
||||||
tags:
|
|
||||||
- "v*"
|
|
||||||
pull_request:
|
pull_request:
|
||||||
branches:
|
branches:
|
||||||
- "main"
|
- "main"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
docker-build:
|
release-snapshot:
|
||||||
name: "docker-build"
|
name: "release-snapshot"
|
||||||
runs-on: "ubuntu-24.04"
|
runs-on: "ubuntu-24.04"
|
||||||
permissions:
|
permissions:
|
||||||
contents: "read"
|
contents: "read"
|
||||||
packages: "write"
|
packages: "write"
|
||||||
env:
|
id-token: "write"
|
||||||
DOCKER_BUILD_FLAGS: "--push"
|
|
||||||
DOCKER_TAG_NAME: ${{ startsWith(github.ref, 'refs/tags/') && github.ref_name || 'latest' }}
|
|
||||||
steps:
|
steps:
|
||||||
- uses: "actions/checkout@v4"
|
- uses: "actions/checkout@v4"
|
||||||
- uses: "docker/setup-qemu-action@v2"
|
with:
|
||||||
- uses: "docker/setup-buildx-action@v2"
|
fetch-depth: 0
|
||||||
- uses: "docker/login-action@v2"
|
- uses: "actions/setup-go@v5"
|
||||||
|
with:
|
||||||
|
go-version: stable
|
||||||
|
- uses: "actions/setup-node@v4"
|
||||||
|
with:
|
||||||
|
node-version: 22
|
||||||
|
- run: "npm ci"
|
||||||
|
- uses: "docker/setup-qemu-action@v3"
|
||||||
|
- uses: "docker/setup-buildx-action@v3"
|
||||||
|
- uses: "docker/login-action@v3"
|
||||||
with:
|
with:
|
||||||
registry: "ghcr.io"
|
registry: "ghcr.io"
|
||||||
username: ${{ github.actor }}
|
username: ${{ github.actor }}
|
||||||
password: ${{ secrets.GITHUB_TOKEN }}
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
- run: "make docker-build"
|
- uses: "sigstore/cosign-installer@v3"
|
||||||
|
- uses: "anchore/sbom-action/download-syft@v0"
|
||||||
|
- uses: "goreleaser/goreleaser-action@v6"
|
||||||
|
with:
|
||||||
|
distribution: "goreleaser"
|
||||||
|
version: "~> v2"
|
||||||
|
args: "release --clean ${{ github.event_name == 'pull_request' && '--snapshot' || '' }}"
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
trivy-scan:
|
trivy-scan:
|
||||||
name: "trivy-scan"
|
name: "trivy-scan"
|
||||||
needs:
|
needs:
|
||||||
- "docker-build"
|
- "release-snapshot"
|
||||||
runs-on: "ubuntu-22.04"
|
runs-on: "ubuntu-22.04"
|
||||||
|
# Only run security scan for main branch (not for PR snapshots since they aren't pushed)
|
||||||
|
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
|
||||||
permissions:
|
permissions:
|
||||||
contents: "read"
|
contents: "read"
|
||||||
packages: "read"
|
packages: "read"
|
||||||
env:
|
env:
|
||||||
DOCKER_TAG_NAME: ${{ startsWith(github.ref, 'refs/tags/') && github.ref_name || 'latest' }}
|
|
||||||
TRIVY_DISABLE_VEX_NOTICE: true
|
TRIVY_DISABLE_VEX_NOTICE: true
|
||||||
steps:
|
steps:
|
||||||
- uses: "aquasecurity/trivy-action@0.28.0"
|
- uses: "aquasecurity/trivy-action@0.28.0"
|
||||||
with:
|
with:
|
||||||
image-ref: 'ghcr.io/getprobo/probo:${{ env.DOCKER_TAG_NAME }}'
|
image-ref: "ghcr.io/getprobo/probo:latest"
|
||||||
format: "table"
|
format: "table"
|
||||||
exit-code: 1
|
exit-code: 1
|
||||||
ignore-unfixed: true
|
ignore-unfixed: true
|
||||||
|
|||||||
Reference in New Issue
Block a user