Skip to content

Commit

Permalink
ci: Extend GH Action to build ARM image
Browse files Browse the repository at this point in the history
Signed-off-by: Kimonas Sotirchos <[email protected]>
  • Loading branch information
kimwnasptd committed Jun 17, 2023
1 parent f71f790 commit dd3a8b3
Showing 1 changed file with 10 additions and 27 deletions.
37 changes: 10 additions & 27 deletions .github/workflows/web-app-docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ on:
pull_request:

env:
IMAGE_NAME: models-web-app
IMG: kserve/models-web-app
ARCH: linux/ppc64le,linux/amd64,linux/arm64

jobs:
# Run tests.
Expand All @@ -27,12 +28,8 @@ jobs:

- name: Run tests
run: |
if [ -f docker-compose.test.yml ]; then
docker-compose --file docker-compose.test.yml build
docker-compose --file docker-compose.test.yml run sut
else
docker build . --file Dockerfile
fi
make docker-build
# Push image to GitHub Packages.
# See also https://docs.docker.com/docker-hub/builds/
push:
Expand Down Expand Up @@ -61,28 +58,14 @@ jobs:

- name: export version variable
run: |
IMAGE_ID=kserve/$IMAGE_NAME
# Change all uppercase to lowercase
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')
# Strip git ref prefix from version
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
# Strip "v" prefix from tag name
# [[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//')
TAG=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
# Use Docker `latest` tag convention
[ "$VERSION" == "master" ] && VERSION=latest
[ "$TAG" == "master" ] && VERSION=latest
echo VERSION=$VERSION >> $GITHUB_ENV
echo IMAGE_ID=$IMAGE_ID >> $GITHUB_ENV
echo TAG=$TAG >> $GITHUB_ENV
- name: Build and push
uses: docker/build-push-action@v3
with:
platforms: linux/amd64,linux/ppc64le
context: .
file: Dockerfile
push: true
tags: ${{ env.IMAGE_ID }}:${{ env.VERSION }}
- name: Build and push multi-arch docker image
run: |
make docker-build-push-multi-arch

0 comments on commit dd3a8b3

Please sign in to comment.