-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add mutli arch build and manifest for the operator repo
Signed-off-by: Mohamed Mahmoud <[email protected]>
- Loading branch information
1 parent
8abeb40
commit 48ad0c6
Showing
7 changed files
with
120 additions
and
37 deletions.
There are no files selected for viewing
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 |
---|---|---|
|
@@ -17,12 +17,15 @@ jobs: | |
id-token: write # needed for signing the images with GitHub OIDC Token | ||
|
||
runs-on: ubuntu-latest | ||
env: | ||
WF_BPFMAN_AGENT_IMG: quay.io/bpfman/bpfman-agent | ||
WF_BPFMAN_OPERATOR_IMG: quay.io/bpfman/bpfman-operator | ||
WF_MULTIARCH_TARGETS: amd64 # comment out other arch arm64 ppc64le s390x till we sort out microdnf issue | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
image: | ||
- registry: quay.io | ||
build_language: go | ||
repository: bpfman | ||
image: bpfman-agent | ||
dockerfile: ./Containerfile.bpfman-agent | ||
|
@@ -36,7 +39,6 @@ jobs: | |
type=raw,value=latest,enable={{is_default_branch}} | ||
- registry: quay.io | ||
build_language: go | ||
repository: bpfman | ||
image: bpfman-operator | ||
dockerfile: ./Containerfile.bpfman-operator | ||
|
@@ -50,7 +52,6 @@ jobs: | |
type=raw,value=latest,enable={{is_default_branch}} | ||
- registry: quay.io | ||
build_language: go | ||
repository: bpfman | ||
image: bpfman-operator-bundle | ||
context: . | ||
|
@@ -62,16 +63,26 @@ jobs: | |
type=sha,format=long | ||
# set latest tag for default branch | ||
type=raw,value=latest,enable={{is_default_branch}} | ||
- registry: quay.io | ||
repository: bpfman | ||
image: mutli-arch-images | ||
context: . | ||
tags: | | ||
type=ref,event=branch | ||
type=ref,event=tag | ||
type=ref,event=pr | ||
type=sha,format=long | ||
# set latest tag for default branch | ||
type=raw,value=latest,enable={{is_default_branch}} | ||
name: Build Image (${{ matrix.image.image }}) | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: actions/setup-go@v5 | ||
if: ${{ matrix.image.build_language == 'go' }} | ||
with: | ||
# prettier-ignore | ||
go-version: '1.21' # yamllint disable-line rule:quoted-strings | ||
go-version: '1.22' # yamllint disable-line rule:quoted-strings | ||
|
||
- uses: sigstore/[email protected] | ||
|
||
|
@@ -98,6 +109,7 @@ jobs: | |
- name: Build image | ||
id: build-image | ||
uses: redhat-actions/buildah-build@v2 | ||
if: ${{ matrix.image.image != 'mutli-arch-images' }} | ||
with: | ||
image: ${{ matrix.image.image }} | ||
tags: ${{ steps.meta.outputs.tags }} | ||
|
@@ -109,7 +121,7 @@ jobs: | |
- name: Push to registry | ||
id: push-image | ||
uses: redhat-actions/push-to-registry@v2 | ||
if: ${{ github.event_name == 'push' }} | ||
if: ${{ github.event_name == 'push' && matrix.image.image != 'mutli-arch-images' }} | ||
with: | ||
tags: ${{ steps.meta.outputs.tags }} | ||
|
||
|
@@ -120,3 +132,16 @@ jobs: | |
for tag in ${tags[@]}; do | ||
cosign sign -y "${tag}@${{ steps.push-image.outputs.digest }}" | ||
done | ||
- name: get short sha | ||
run: | | ||
echo "short_sha=$(git rev-parse --short HEAD)" >> $GITHUB_ENV | ||
- name: Build multi arch images | ||
if: ${{ matrix.image.image == 'mutli-arch-images' }} | ||
run: | | ||
BPFMAN_AGENT_IMG="${{ env.WF_BPFMAN_AGENT_IMG }}:${{ env.short_sha }}" BPFMAN_OPERATOR_IMG="${{ env.WF_BPFMAN_OPERATOR_IMG}}:${{ env.short_sha }}" MULTIARCH_TARGETS="${{ env.WF_MULTIARCH_TARGETS }}" make build-images | ||
- name: Push multi arch images and manifest | ||
if: ${{ github.event_name == 'push' && matrix.image.image == 'mutli-arch-images' }} | ||
run: | | ||
BPFMAN_AGENT_IMG="${{ env.WF_BPFMAN_AGENT_IMG }}:${{ env.short_sha }}" BPFMAN_OPERATOR_IMG="${{ env.WF_BPFMAN_OPERATOR_IMG}}:${{ env.short_sha }}" MULTIARCH_TARGETS="${{ env.WF_MULTIARCH_TARGETS }}" make images |
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
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
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
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
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
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