2023-01-18 17:57:58 +00:00
|
|
|
name: Publish images
|
|
|
|
|
2023-06-30 11:44:57 +00:00
|
|
|
permissions: {}
|
|
|
|
|
2023-01-18 17:57:58 +00:00
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- 'main'
|
|
|
|
- 'release*'
|
|
|
|
|
|
|
|
concurrency:
|
|
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
|
|
cancel-in-progress: true
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
publish-images:
|
|
|
|
runs-on: ubuntu-latest
|
2023-06-30 07:22:10 +00:00
|
|
|
permissions:
|
|
|
|
packages: write
|
|
|
|
id-token: write
|
2023-04-07 15:20:56 +00:00
|
|
|
outputs:
|
|
|
|
kyverno-digest: ${{ steps.publish-kyverno.outputs.digest }}
|
|
|
|
kyverno-init-digest: ${{ steps.publish-kyverno-init.outputs.digest }}
|
|
|
|
background-controller-digest: ${{ steps.publish-background-controller.outputs.digest }}
|
|
|
|
cleanup-controller-digest: ${{ steps.publish-cleanup-controller.outputs.digest }}
|
|
|
|
cli-digest: ${{ steps.publish-cli.outputs.digest }}
|
2023-04-07 17:37:07 +00:00
|
|
|
reports-controller-digest: ${{ steps.publish-reports-controller.outputs.digest }}
|
2023-01-18 17:57:58 +00:00
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2023-10-25 04:29:31 +00:00
|
|
|
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
2023-09-27 08:24:27 +00:00
|
|
|
- name: Setup caches
|
|
|
|
uses: ./.github/actions/setup-caches
|
|
|
|
timeout-minutes: 5
|
|
|
|
continue-on-error: true
|
|
|
|
with:
|
|
|
|
build-cache-key: publish-images
|
2023-01-18 17:57:58 +00:00
|
|
|
- name: Setup build env
|
|
|
|
uses: ./.github/actions/setup-build-env
|
2023-09-20 21:50:00 +00:00
|
|
|
timeout-minutes: 30
|
2023-01-18 17:57:58 +00:00
|
|
|
- name: Run Trivy vulnerability scanner in repo mode
|
2023-10-27 13:19:01 +00:00
|
|
|
uses: aquasecurity/trivy-action@b77b85c0254bba6789e787844f0585cde1e56320 # v0.13.0
|
2023-01-18 17:57:58 +00:00
|
|
|
with:
|
|
|
|
scan-type: 'fs'
|
|
|
|
ignore-unfixed: true
|
|
|
|
format: 'sarif'
|
|
|
|
output: 'trivy-results.sarif'
|
|
|
|
severity: 'CRITICAL,HIGH'
|
|
|
|
- name: Install Cosign
|
2023-09-04 12:07:07 +00:00
|
|
|
uses: sigstore/cosign-installer@11086d25041f77fe8fe7b9ea4e48e3b9192b8f19 # v3.1.2
|
2023-01-18 17:57:58 +00:00
|
|
|
- name: Publish kyverno
|
2023-04-07 15:20:56 +00:00
|
|
|
id: publish-kyverno
|
2023-01-18 17:57:58 +00:00
|
|
|
uses: ./.github/actions/publish-image
|
|
|
|
with:
|
2023-04-07 12:10:53 +00:00
|
|
|
makefile-target: ko-publish-kyverno
|
2023-01-18 17:57:58 +00:00
|
|
|
registry: ghcr.io
|
|
|
|
registry-username: ${{ github.actor }}
|
2023-06-30 07:22:10 +00:00
|
|
|
registry-password: ${{ secrets.GITHUB_TOKEN }}
|
2023-01-18 17:57:58 +00:00
|
|
|
repository: ${{ github.repository_owner }}
|
2023-04-07 13:47:15 +00:00
|
|
|
version: ${{ github.ref_name }}
|
2023-01-18 17:57:58 +00:00
|
|
|
sign-image: true
|
|
|
|
sbom-name: kyverno
|
|
|
|
sbom-repository: ghcr.io/${{ github.repository_owner }}/sbom
|
|
|
|
signature-repository: ghcr.io/${{ github.repository_owner }}/signatures
|
|
|
|
main-path: ./cmd/kyverno
|
2023-04-07 13:47:15 +00:00
|
|
|
- name: Publish kyverno-init
|
2023-04-07 15:20:56 +00:00
|
|
|
id: publish-kyverno-init
|
2023-01-18 17:57:58 +00:00
|
|
|
uses: ./.github/actions/publish-image
|
|
|
|
with:
|
2023-04-07 12:10:53 +00:00
|
|
|
makefile-target: ko-publish-kyverno-init
|
2023-01-18 17:57:58 +00:00
|
|
|
registry: ghcr.io
|
|
|
|
registry-username: ${{ github.actor }}
|
2023-06-30 07:22:10 +00:00
|
|
|
registry-password: ${{ secrets.GITHUB_TOKEN }}
|
2023-01-18 17:57:58 +00:00
|
|
|
repository: ${{ github.repository_owner }}
|
2023-04-07 12:10:53 +00:00
|
|
|
version: ${{ github.ref_name }}
|
2023-01-18 17:57:58 +00:00
|
|
|
sign-image: true
|
2023-04-07 13:47:15 +00:00
|
|
|
sbom-name: kyverno-init
|
2023-01-18 17:57:58 +00:00
|
|
|
sbom-repository: ghcr.io/${{ github.repository_owner }}/sbom
|
|
|
|
signature-repository: ghcr.io/${{ github.repository_owner }}/signatures
|
2023-01-29 20:49:45 +00:00
|
|
|
main-path: ./cmd/kyverno-init
|
2023-04-07 15:20:56 +00:00
|
|
|
- name: Publish background-controller
|
|
|
|
id: publish-background-controller
|
|
|
|
uses: ./.github/actions/publish-image
|
|
|
|
with:
|
|
|
|
makefile-target: ko-publish-background-controller
|
|
|
|
registry: ghcr.io
|
|
|
|
registry-username: ${{ github.actor }}
|
2023-06-30 07:22:10 +00:00
|
|
|
registry-password: ${{ secrets.GITHUB_TOKEN }}
|
2023-04-07 15:20:56 +00:00
|
|
|
repository: ${{ github.repository_owner }}
|
|
|
|
version: ${{ github.ref_name }}
|
|
|
|
sign-image: true
|
|
|
|
sbom-name: background-controller
|
|
|
|
sbom-repository: ghcr.io/${{ github.repository_owner }}/sbom
|
|
|
|
signature-repository: ghcr.io/${{ github.repository_owner }}/signatures
|
|
|
|
main-path: ./cmd/background-controller
|
2023-01-18 17:57:58 +00:00
|
|
|
- name: Publish cleanup-controller
|
2023-04-07 15:20:56 +00:00
|
|
|
id: publish-cleanup-controller
|
2023-01-18 17:57:58 +00:00
|
|
|
uses: ./.github/actions/publish-image
|
|
|
|
with:
|
2023-04-07 12:10:53 +00:00
|
|
|
makefile-target: ko-publish-cleanup-controller
|
2023-01-18 17:57:58 +00:00
|
|
|
registry: ghcr.io
|
|
|
|
registry-username: ${{ github.actor }}
|
2023-06-30 07:22:10 +00:00
|
|
|
registry-password: ${{ secrets.GITHUB_TOKEN }}
|
2023-01-18 17:57:58 +00:00
|
|
|
repository: ${{ github.repository_owner }}
|
2023-04-07 12:10:53 +00:00
|
|
|
version: ${{ github.ref_name }}
|
2023-01-18 17:57:58 +00:00
|
|
|
sign-image: true
|
|
|
|
sbom-name: cleanup-controller
|
|
|
|
sbom-repository: ghcr.io/${{ github.repository_owner }}/sbom
|
|
|
|
signature-repository: ghcr.io/${{ github.repository_owner }}/signatures
|
|
|
|
main-path: ./cmd/cleanup-controller
|
|
|
|
- name: Publish cli
|
2023-04-07 15:20:56 +00:00
|
|
|
id: publish-cli
|
2023-01-18 17:57:58 +00:00
|
|
|
uses: ./.github/actions/publish-image
|
|
|
|
with:
|
2023-04-07 12:10:53 +00:00
|
|
|
makefile-target: ko-publish-cli
|
2023-01-18 17:57:58 +00:00
|
|
|
registry: ghcr.io
|
|
|
|
registry-username: ${{ github.actor }}
|
2023-06-30 07:22:10 +00:00
|
|
|
registry-password: ${{ secrets.GITHUB_TOKEN }}
|
2023-01-18 17:57:58 +00:00
|
|
|
repository: ${{ github.repository_owner }}
|
2023-04-07 12:10:53 +00:00
|
|
|
version: ${{ github.ref_name }}
|
2023-01-18 17:57:58 +00:00
|
|
|
sign-image: true
|
|
|
|
sbom-name: cli
|
|
|
|
sbom-repository: ghcr.io/${{ github.repository_owner }}/sbom
|
|
|
|
signature-repository: ghcr.io/${{ github.repository_owner }}/signatures
|
|
|
|
main-path: ./cmd/cli/kubectl-kyverno
|
2023-02-02 18:51:14 +00:00
|
|
|
- name: Publish reports-controller
|
2023-04-07 15:20:56 +00:00
|
|
|
id: publish-reports-controller
|
2023-02-02 18:51:14 +00:00
|
|
|
uses: ./.github/actions/publish-image
|
|
|
|
with:
|
2023-04-07 12:10:53 +00:00
|
|
|
makefile-target: ko-publish-reports-controller
|
2023-02-02 18:51:14 +00:00
|
|
|
registry: ghcr.io
|
|
|
|
registry-username: ${{ github.actor }}
|
2023-06-30 07:22:10 +00:00
|
|
|
registry-password: ${{ secrets.GITHUB_TOKEN }}
|
2023-02-02 18:51:14 +00:00
|
|
|
repository: ${{ github.repository_owner }}
|
2023-04-07 12:10:53 +00:00
|
|
|
version: ${{ github.ref_name }}
|
2023-02-02 18:51:14 +00:00
|
|
|
sign-image: true
|
|
|
|
sbom-name: reports-controller
|
|
|
|
sbom-repository: ghcr.io/${{ github.repository_owner }}/sbom
|
|
|
|
signature-repository: ghcr.io/${{ github.repository_owner }}/signatures
|
|
|
|
main-path: ./cmd/reports-controller
|
2023-04-07 15:20:56 +00:00
|
|
|
|
|
|
|
generate-kyverno-provenance:
|
|
|
|
needs: publish-images
|
|
|
|
permissions:
|
|
|
|
id-token: write # To sign the provenance.
|
|
|
|
packages: write # To upload assets to release.
|
|
|
|
actions: read # To read the workflow path.
|
|
|
|
# NOTE: The container generator workflow is not officially released as GA.
|
2023-08-23 08:11:32 +00:00
|
|
|
uses: slsa-framework/slsa-github-generator/.github/workflows/generator_container_slsa3.yml@v1.9.0
|
2023-04-07 15:20:56 +00:00
|
|
|
with:
|
|
|
|
image: ghcr.io/${{ github.repository_owner }}/kyverno
|
|
|
|
digest: "${{ needs.publish-images.outputs.kyverno-digest }}"
|
|
|
|
registry-username: ${{ github.actor }}
|
|
|
|
secrets:
|
2023-06-30 07:22:10 +00:00
|
|
|
registry-password: ${{ secrets.GITHUB_TOKEN }}
|
2023-04-07 15:20:56 +00:00
|
|
|
|
|
|
|
generate-kyverno-init-provenance:
|
|
|
|
needs: publish-images
|
|
|
|
permissions:
|
|
|
|
id-token: write # To sign the provenance.
|
|
|
|
packages: write # To upload assets to release.
|
|
|
|
actions: read # To read the workflow path.
|
|
|
|
# NOTE: The container generator workflow is not officially released as GA.
|
2023-08-23 08:11:32 +00:00
|
|
|
uses: slsa-framework/slsa-github-generator/.github/workflows/generator_container_slsa3.yml@v1.9.0
|
2023-04-07 15:20:56 +00:00
|
|
|
with:
|
|
|
|
image: ghcr.io/${{ github.repository_owner }}/kyvernopre
|
|
|
|
digest: "${{ needs.publish-images.outputs.kyverno-init-digest }}"
|
|
|
|
registry-username: ${{ github.actor }}
|
|
|
|
secrets:
|
2023-06-30 07:22:10 +00:00
|
|
|
registry-password: ${{ secrets.GITHUB_TOKEN }}
|
2023-04-07 15:20:56 +00:00
|
|
|
|
|
|
|
generate-background-controller-provenance:
|
|
|
|
needs: publish-images
|
|
|
|
permissions:
|
|
|
|
id-token: write # To sign the provenance.
|
|
|
|
packages: write # To upload assets to release.
|
|
|
|
actions: read # To read the workflow path.
|
|
|
|
# NOTE: The container generator workflow is not officially released as GA.
|
2023-08-23 08:11:32 +00:00
|
|
|
uses: slsa-framework/slsa-github-generator/.github/workflows/generator_container_slsa3.yml@v1.9.0
|
2023-04-07 15:20:56 +00:00
|
|
|
with:
|
|
|
|
image: ghcr.io/${{ github.repository_owner }}/background-controller
|
|
|
|
digest: "${{ needs.publish-images.outputs.background-controller-digest }}"
|
|
|
|
registry-username: ${{ github.actor }}
|
|
|
|
secrets:
|
2023-06-30 07:22:10 +00:00
|
|
|
registry-password: ${{ secrets.GITHUB_TOKEN }}
|
2023-04-07 15:20:56 +00:00
|
|
|
|
|
|
|
generate-cleanup-controller-provenance:
|
|
|
|
needs: publish-images
|
|
|
|
permissions:
|
|
|
|
id-token: write # To sign the provenance.
|
|
|
|
packages: write # To upload assets to release.
|
|
|
|
actions: read # To read the workflow path.
|
|
|
|
# NOTE: The container generator workflow is not officially released as GA.
|
2023-08-23 08:11:32 +00:00
|
|
|
uses: slsa-framework/slsa-github-generator/.github/workflows/generator_container_slsa3.yml@v1.9.0
|
2023-04-07 15:20:56 +00:00
|
|
|
with:
|
|
|
|
image: ghcr.io/${{ github.repository_owner }}/cleanup-controller
|
|
|
|
digest: "${{ needs.publish-images.outputs.cleanup-controller-digest }}"
|
|
|
|
registry-username: ${{ github.actor }}
|
|
|
|
secrets:
|
2023-06-30 07:22:10 +00:00
|
|
|
registry-password: ${{ secrets.GITHUB_TOKEN }}
|
2023-04-07 15:20:56 +00:00
|
|
|
|
|
|
|
generate-kyverno-cli-provenance:
|
|
|
|
needs: publish-images
|
|
|
|
permissions:
|
|
|
|
id-token: write # To sign the provenance.
|
|
|
|
packages: write # To upload assets to release.
|
|
|
|
actions: read # To read the workflow path.
|
|
|
|
# NOTE: The container generator workflow is not officially released as GA.
|
2023-08-23 08:11:32 +00:00
|
|
|
uses: slsa-framework/slsa-github-generator/.github/workflows/generator_container_slsa3.yml@v1.9.0
|
2023-04-07 15:20:56 +00:00
|
|
|
with:
|
|
|
|
image: ghcr.io/${{ github.repository_owner }}/kyverno-cli
|
|
|
|
digest: "${{ needs.publish-images.outputs.cli-digest }}"
|
|
|
|
registry-username: ${{ github.actor }}
|
|
|
|
secrets:
|
2023-06-30 07:22:10 +00:00
|
|
|
registry-password: ${{ secrets.GITHUB_TOKEN }}
|
2023-04-07 15:20:56 +00:00
|
|
|
|
|
|
|
generate-reports-controller-provenance:
|
|
|
|
needs: publish-images
|
|
|
|
permissions:
|
|
|
|
id-token: write # To sign the provenance.
|
|
|
|
packages: write # To upload assets to release.
|
|
|
|
actions: read # To read the workflow path.
|
|
|
|
# NOTE: The container generator workflow is not officially released as GA.
|
2023-08-23 08:11:32 +00:00
|
|
|
uses: slsa-framework/slsa-github-generator/.github/workflows/generator_container_slsa3.yml@v1.9.0
|
2023-04-07 15:20:56 +00:00
|
|
|
with:
|
|
|
|
image: ghcr.io/${{ github.repository_owner }}/reports-controller
|
|
|
|
digest: "${{ needs.publish-images.outputs.reports-controller-digest }}"
|
|
|
|
registry-username: ${{ github.actor }}
|
|
|
|
secrets:
|
2023-06-30 07:22:10 +00:00
|
|
|
registry-password: ${{ secrets.GITHUB_TOKEN }}
|