Skip to content

Build multiarch image for quarkus app #89

Build multiarch image for quarkus app

Build multiarch image for quarkus app #89

Workflow file for this run

name: Build
on:
pull_request:
branches:
- main
paths-ignore:
- '**.md'
push:
branches:
- main
- multiarch-build
paths-ignore:
- '**.md'
jobs:
build:
if: github.repository_owner == 'hawtio'
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
java: ['17', '21']
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: ${{ matrix.java }}
cache: 'maven'
- name: Build
run: |
mvn --batch-mode --no-transfer-progress install \
-Dquarkus.jib.base-jvm-image=registry.access.redhat.com/ubi8/openjdk-${{matrix.java}}-runtime:latest \
-Dquarkus.jib.platforms=linux/amd64,linux/arm64,linux/ppc64le,linux/s390x \
-Dquarkus.container-image.push=false \
-Djkube.build.strategy=docker
- name: Push image to Quay.io
if: github.event_name == 'push'
env:
USERNAME: ${{ secrets.QUAY_USERNAME }}
PASSWORD: ${{ secrets.QUAY_PASSWORD }}
run: |
docker login --help
docker login -u $USERNAME -p $PASSWORD quay.io
mvn --batch-mode --no-transfer-progress install \
-Dquarkus.jib.base-jvm-image=registry.access.redhat.com/ubi8/openjdk-${{matrix.java}}-runtime:latest \
-Dquarkus.jib.platforms=linux/amd64,linux/arm64,linux/ppc64le,linux/s390x \
-Dquarkus.container-image.tag=${{ matrix.java }} \
-Dquarkus.container-image.push=true \
-Djkube.build.strategy=docker
docker tag quay.io/hawtio/hawtio-online-example-camel-springboot:latest quay.io/hawtio/hawtio-online-example-camel-springboot:${{matrix.java}}
docker push quay.io/hawtio/hawtio-online-example-camel-springboot:${{matrix.java}}
if [[ "${{matrix.java}}" == "21" ]]; then
docker buildx imagetools create -t quay.io/hawtio/hawtio-online-example-camel-quarkus:latest quay.io/hawtio/hawtio-online-example-camel-quarkus:${{ matrix.java }}
docker push quay.io/hawtio/hawtio-online-example-camel-springboot:latest
fi