2024-01-27 23:32:42 +01:00
|
|
|
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
|
|
|
|
|
2023-01-18 18:09:37 +01:00
|
|
|
name: Build images
|
|
|
|
|
2023-06-30 13:44:57 +02:00
|
|
|
permissions: {}
|
|
|
|
|
2023-01-18 18:09:37 +01:00
|
|
|
on:
|
2024-09-10 16:52:09 +02:00
|
|
|
pull_request:
|
2023-01-18 18:09:37 +01:00
|
|
|
branches:
|
2024-09-10 16:52:09 +02:00
|
|
|
- main
|
|
|
|
- release-*
|
2023-01-18 18:09:37 +01:00
|
|
|
|
|
|
|
concurrency:
|
|
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
|
|
cancel-in-progress: true
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build-images:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2024-10-08 09:20:08 +00:00
|
|
|
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
|
2023-09-27 10:24:27 +02:00
|
|
|
- name: Setup caches
|
|
|
|
uses: ./.github/actions/setup-caches
|
|
|
|
timeout-minutes: 5
|
|
|
|
continue-on-error: true
|
|
|
|
with:
|
|
|
|
build-cache-key: build-images
|
2023-01-18 18:09:37 +01:00
|
|
|
- name: Setup build env
|
|
|
|
uses: ./.github/actions/setup-build-env
|
2023-08-30 22:44:51 +02:00
|
|
|
timeout-minutes: 10
|
2023-01-18 18:09:37 +01:00
|
|
|
- name: ko build
|
2023-04-07 14:10:53 +02:00
|
|
|
run: VERSION=${{ github.ref_name }} make ko-build-all
|
2023-01-18 18:09:37 +01:00
|
|
|
- name: Trivy Scan Image
|
2024-07-12 08:42:47 +00:00
|
|
|
uses: aquasecurity/trivy-action@6e7b7d1fd3e4fef0c5fa8cce1229c54b2c9bd0d8 # v0.24.0
|
2023-01-18 18:09:37 +01:00
|
|
|
with:
|
|
|
|
scan-type: 'fs'
|
|
|
|
ignore-unfixed: true
|
|
|
|
format: 'sarif'
|
|
|
|
output: 'trivy-results.sarif'
|
|
|
|
severity: 'CRITICAL,HIGH'
|
2024-10-07 18:09:28 +05:30
|
|
|
env:
|
|
|
|
# Trivy is returning TOOMANYREQUESTS
|
|
|
|
# See: https://github.com/aquasecurity/trivy-action/issues/389#issuecomment-2385416577
|
|
|
|
TRIVY_DB_REPOSITORY: 'public.ecr.aws/aquasecurity/trivy-db:2'
|