Skip to content

Commit

Permalink
Enabled CI to provide additional support for s390x and power
Browse files Browse the repository at this point in the history
Signed-off-by: Nishan Acharya IBM <mamabapuni@gmail.com>
  • Loading branch information
Nash-123 committed Aug 30, 2024
1 parent 09790de commit 0518694
Showing 1 changed file with 66 additions and 0 deletions.
66 changes: 66 additions & 0 deletions .github/workflows/build.yaml
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

0 comments on commit 0518694

Please sign in to comment.