-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: update GH actions building container image
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
Showing
4 changed files
with
209 additions
and
274 deletions.
There are no files selected for viewing
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Oops, something went wrong.