Skip to content

Commit

Permalink
refactor: update GH actions building container image
Browse files Browse the repository at this point in the history
Update the GitHub actions used to build and release the container image.
The new ones are copy&paste from the kubewarden-controller.

Signed-off-by: Flavio Castelli <[email protected]>
  • Loading branch information
flavio committed Jul 18, 2023
1 parent 6be2466 commit e75bfdc
Show file tree
Hide file tree
Showing 4 changed files with 209 additions and 274 deletions.
File renamed without changes.
51 changes: 51 additions & 0 deletions .github/workflows/container-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Build container image every change.

on:
workflow_call:
outputs:
digest:
description: "Container image digest"
value: ${{jobs.build.outputs.digest}}
push:
branches:
- "*"

jobs:
build:
name: Build
uses: .github/workflows/container-image.yml
permissions:
packages: write
with:
push-image: true

sign:
runs-on: ubuntu-latest
permissions:
packages: write
id-token: write
needs: build
steps:
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- uses: sigstore/[email protected]
- name: Sign the images
run: |
cosign sign \
${{needs.build.outputs.repository}}@${{needs.build.outputs.digest}}
env:
COSIGN_EXPERIMENTAL: 1

- uses: sigstore/[email protected]
- name: Sign the SBOM
run: |
tag=$(echo '${{needs.build.outputs.digest}}' | sed 's/:/-/g')
cosign sign \
"${{needs.build.outputs.repository}}:$tag.sbom"
env:
COSIGN_EXPERIMENTAL: 1
Loading

0 comments on commit e75bfdc

Please sign in to comment.