Skip to content

Commit

Permalink
Adding support for multiple architectures in github action for kserv…
Browse files Browse the repository at this point in the history
…e-controller (kubeflow#2550)

Signed-off-by: adilhusain-s <Adilhusain.Shaikh@ibm.com>

Signed-off-by: adilhusain-s <Adilhusain.Shaikh@ibm.com>
  • Loading branch information
adilhusain-s authored Dec 22, 2022
1 parent 89c7e4f commit 35427d1
Showing 1 changed file with 24 additions and 14 deletions.
38 changes: 24 additions & 14 deletions .github/workflows/kserve-controller-docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ on:

env:
IMAGE_NAME: kserve-controller

DOCKER_USER: ${{secrets.DOCKER_USER}}
jobs:
# Run tests.
# See also https://docs.docker.com/docker-hub/builds/automated-testing/
Expand Down Expand Up @@ -46,16 +46,21 @@ jobs:
steps:
- uses: actions/checkout@v2

- name: Build image
run: |
docker build . --file Dockerfile --tag $IMAGE_NAME
- name: Setup QEMU
uses: docker/setup-qemu-action@v2

- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Log into registry
run: docker login -u ${{ secrets.DOCKER_USER }} -p ${{ secrets.DOCKER_PASSWORD }}
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Push image
- name: export version variable
run: |
IMAGE_ID=kserve/$IMAGE_NAME
IMAGE_ID=$DOCKER_USER/$IMAGE_NAME
# Change all uppercase to lowercase
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')
Expand All @@ -69,9 +74,14 @@ jobs:
# Use Docker `latest` tag convention
[ "$VERSION" == "master" ] && VERSION=latest
echo IMAGE_ID=$IMAGE_ID
echo VERSION=$VERSION
docker tag $IMAGE_NAME $IMAGE_ID:$VERSION
docker push $IMAGE_ID:$VERSION
echo VERSION=$VERSION >> $GITHUB_ENV
echo IMAGE_ID=$IMAGE_ID >> $GITHUB_ENV
- name: Build and push
uses: docker/build-push-action@v3
with:
platforms: linux/amd64,linux/arm/v7,linux/arm64/v8,linux/ppc64le,linux/s390x
context: .
file: Dockerfile
push: true
tags: ${{ env.IMAGE_ID }}:${{ env.VERSION }}

0 comments on commit 35427d1

Please sign in to comment.