mirror of
https://github.com/aquasecurity/trivy.git
synced 2025-12-12 15:50:15 -08:00
ci: add pushing canary build images to registries (#2428)
This commit is contained in:
4
.github/workflows/canary.yaml
vendored
4
.github/workflows/canary.yaml
vendored
@@ -3,6 +3,10 @@ on:
|
||||
push:
|
||||
branches:
|
||||
- 'main'
|
||||
paths:
|
||||
- '**.go'
|
||||
- 'Dockerfile.canary'
|
||||
- '.github/workflows/canary.yaml'
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
|
||||
15
.github/workflows/reusable-release.yaml
vendored
15
.github/workflows/reusable-release.yaml
vendored
@@ -84,6 +84,21 @@ jobs:
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.ORG_REPO_TOKEN }}
|
||||
|
||||
## push images to registries
|
||||
## only for canary build
|
||||
- name: Build and push
|
||||
if: ${{ inputs.goreleaser_config == 'goreleaser-canary.yml' }}
|
||||
uses: docker/build-push-action@v3
|
||||
with:
|
||||
platforms: linux/amd64, linux/arm64
|
||||
file: ./Dockerfile.canary # path to Dockerfile
|
||||
context: .
|
||||
push: true
|
||||
tags: |
|
||||
aquasec/trivy:canary
|
||||
ghcr.io/aquasecurity/trivy:canary
|
||||
public.ecr.aws/aquasecurity/trivy:canary
|
||||
|
||||
- name: Cache Trivy binaries
|
||||
uses: actions/cache@v3.0.4
|
||||
with:
|
||||
|
||||
10
Dockerfile.canary
Normal file
10
Dockerfile.canary
Normal file
@@ -0,0 +1,10 @@
|
||||
FROM alpine:3.16.0
|
||||
RUN apk --no-cache add ca-certificates git
|
||||
|
||||
# binaries were created with GoReleaser
|
||||
# need to copy binaries from folder with correct architecture
|
||||
# example architecture folder: dist/trivy_canary_build_linux_arm64/trivy
|
||||
ARG TARGETARCH
|
||||
COPY "dist/trivy_canary_build_linux_${TARGETARCH}/trivy" /usr/local/bin/trivy
|
||||
COPY contrib/*.tpl contrib/
|
||||
ENTRYPOINT ["trivy"]
|
||||
Reference in New Issue
Block a user