Skip to content

Commit

Permalink
Merge pull request #1691 from arthurus-rex/main
Browse files Browse the repository at this point in the history
ci: sign all image builds
  • Loading branch information
dave-tucker authored Aug 22, 2024
2 parents c106b46 + debcd06 commit 8bcbc25
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
1 change: 0 additions & 1 deletion .github/workflows/image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ jobs:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
id-token: write
strategy:
fail-fast: false
Expand Down
9 changes: 9 additions & 0 deletions .github/workflows/image_base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ on: # yamllint disable-line rule:truthy
jobs:
baseimagebuild:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -24,6 +27,8 @@ jobs:
image: tonistiigi/binfmt:qemu-v8.1.5
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Set up cosign
uses: sigstore/cosign-installer@main
- name: Login to Quay
if: ${{ inputs.pushImage }}
uses: docker/login-action@v3
Expand All @@ -32,10 +37,14 @@ jobs:
username: ${{ secrets.username }}
password: ${{ secrets.password }}
- name: Build and push a base image for building Kepler with libbpf
id: build-push-image
uses: docker/build-push-action@v6
with:
context: .
file: ./build/Dockerfile.builder
platforms: linux/amd64,linux/arm64,linux/s390x
push: ${{ inputs.pushImage }}
tags: quay.io/sustainable_computing_io/kepler_builder:ubi-9-libbpf-1.3.0
- name: Sign images with GitHub OIDC token
run: |
cosign sign -y quay.io/sustainable_computing_io/kepler_builder:ubi-9-libbpf-1.3.0@${{ steps.build-push-image.outputs.digest }}
10 changes: 10 additions & 0 deletions .github/workflows/image_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ on: # yamllint disable-line rule:truthy
jobs:
image_build_for_specific_commit:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -20,6 +23,8 @@ jobs:
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Set up cosign
uses: sigstore/cosign-installer@main
- name: Login to Quay
uses: docker/login-action@v3
with:
Expand All @@ -28,6 +33,7 @@ jobs:
password: ${{ secrets.BOT_TOKEN }}

- name: Build and push
id: build-push-image
uses: docker/build-push-action@v6
with:
context: .
Expand All @@ -36,3 +42,7 @@ jobs:
tags: quay.io/sustainable_computing_io/kepler
labels: ${{ github.event.inputs.commitSHA }}
file: build/Dockerfile.libbpf.kepler

- name: Sign images with GitHub OIDC token
run: |
cosign sign -y quay.io/sustainable_computing_io/kepler@${{ steps.build-push-image.outputs.digest }}

0 comments on commit 8bcbc25

Please sign in to comment.