-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enabled CI to provide additional support for s390x and power
Signed-off-by: Nishan Acharya IBM <mamabapuni@gmail.com>
- Loading branch information
Showing
1 changed file
with
66 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,66 @@ | ||
name: Build and Push Image for Multi-Arch CI- Additional support for s390x & Power along with arm64 & amd64 | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- main | ||
- 'release-[0-9]+\.[0-9]+\.[0-9]+' | ||
tags: | ||
- 'latest' | ||
- 'v*' | ||
|
||
|
||
env: | ||
IMAGE_NAME: "odh-model-controller" | ||
REPO_NAME: "opendatahub" | ||
REGISTRY_NAME: "quay.io" | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
|
||
- name: Setup Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Login to Quay.io | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: quay.io | ||
username: ${{ secrets.QUAY_USER }} | ||
password: ${{ secrets.QUAY_ACCESS_TOKEN }} | ||
|
||
- name: Set Docker Tag | ||
run: | | ||
if [[ "${GITHUB_REF}" == "refs/heads/main" ]]; then | ||
echo "TAG=latest" >> $GITHUB_ENV | ||
elif [[ "${GITHUB_REF}" == refs/heads/release-* ]]; then | ||
VERSION="${GITHUB_REF#refs/heads/release-}" | ||
echo "TAG=v${VERSION}" >> $GITHUB_ENV | ||
elif [[ "${GITHUB_REF}" == refs/tags/v* ]]; then | ||
TAG="${GITHUB_REF#refs/tags/}" | ||
echo "TAG=${TAG}" >> $GITHUB_ENV | ||
else | ||
echo "Branch or tag is not found. Image can't be pushed. Please check and try again!!" | ||
exit 1 | ||
fi | ||
- name: Build and push controller image | ||
uses: docker/build-push-action@v6 | ||
with: | ||
platforms: linux/amd64,linux/arm64,linux/ppc64le,linux/s390x | ||
context: . | ||
file: Containerfile | ||
push: true | ||
tags: | | ||
${{ env.REGISTRY_NAME }}/${{ env.REPO_NAME }}/${{ env.IMAGE_NAME }}:${{ env.TAG }} | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max | ||
debug: true |