From 9fca6b9a6a0f96b7f69aca96d610b81acdb92c3f Mon Sep 17 00:00:00 2001 From: Adam Dyess Date: Tue, 30 Jan 2024 13:27:39 -0600 Subject: [PATCH] Craft multiarch manifests on gh push for all arches defined in rockcraft.yaml --- .github/workflows/pull_request.yaml | 23 +++++++++++++++++++++++ trivy.yaml | 3 +++ 2 files changed, 26 insertions(+) create mode 100644 .github/workflows/pull_request.yaml create mode 100644 trivy.yaml diff --git a/.github/workflows/pull_request.yaml b/.github/workflows/pull_request.yaml new file mode 100644 index 0000000..01f0432 --- /dev/null +++ b/.github/workflows/pull_request.yaml @@ -0,0 +1,23 @@ +name: Push Multiarch Images +on: + pull_request: + push: + branches: + - rockcraft + +jobs: + build-and-push-arch-specifics: + name: Build Rocks and Push Arch Specific Images + uses: canonical/k8s-workflows/.github/workflows/build_rocks.yaml@main + with: + owner: ${{ github.repository_owner }} + trivy-image-config: "trivy.yaml" + multiarch-awareness: true + cache-action: ${{ (github.event_name == 'push') && 'save' || 'restore' }} + build-and-push-multiarch-manifest: + name: Combine Rocks and Push Multiarch Manifest + uses: canonical/k8s-workflows/.github/workflows/assemble_multiarch_image.yaml@main + needs: [build-and-push-arch-specifics] + with: + rock-metas: ${{ needs.build-and-push-arch-specifics.outputs.rock-metas }} + dry-run: ${{ github.event_name != 'push' }} diff --git a/trivy.yaml b/trivy.yaml new file mode 100644 index 0000000..6e79d6f --- /dev/null +++ b/trivy.yaml @@ -0,0 +1,3 @@ +timeout: 20m +scan: + offline-scan: true \ No newline at end of file