Some checks failed
Multiarch build / Build multi-architecture image from scratch (push) Failing after 29s
Signed-off-by: Aleksander Cynarski <aleksander@cynarski.pl>
64 lines
1.8 KiB
YAML
64 lines
1.8 KiB
YAML
name: Multiarch build
|
|
on:
|
|
push:
|
|
pull_request:
|
|
workflow_dispatch:
|
|
schedule:
|
|
- cron: '0 0 * * *' # every day at midnight
|
|
|
|
env:
|
|
PROJECT_DIR: spring-petclinic
|
|
MVN_REPO_DIR: ~/.m2/repository
|
|
IMAGE_TAG: latest
|
|
|
|
jobs:
|
|
build-multiarch-scratch:
|
|
name: Build multi-architecture image from scratch
|
|
env:
|
|
IMAGE_NAME: spring-petclinic-multiarch
|
|
runs-on: ubuntu-22.04
|
|
|
|
steps:
|
|
|
|
# Checkout buildah action github repository
|
|
- name: Checkout Buildah action
|
|
uses: actions/checkout@v4
|
|
with:
|
|
path: "buildah-build"
|
|
|
|
- name: Install latest buildah
|
|
run: |
|
|
bash buildah-build/.gitea/install_latest_buildah.sh
|
|
|
|
- name: Install qemu dependency
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y qemu-user-static
|
|
|
|
- name: Build Image
|
|
id: build_image_multiarch
|
|
uses: redhat-actions/buildah-build@v2
|
|
with:
|
|
image: ${{ env.IMAGE_NAME }}
|
|
tags: ${{ env.IMAGE_TAG }}
|
|
base-image: 'registry.access.redhat.com/ubi9-minimal:9.5'
|
|
archs: amd64, i386, ppc64le
|
|
# To avoid hardcoding a particular version of the binary.
|
|
containerfiles: |
|
|
./Containerfile
|
|
port: 8080
|
|
workdir: "."
|
|
|
|
- name: Echo Outputs
|
|
run: |
|
|
echo "Image: ${{ steps.build_image_multiarch.outputs.image }}"
|
|
echo "Tags: ${{ steps.build_image_multiarch.outputs.tags }}"
|
|
echo "Tagged Image: ${{ steps.build_image_multiarch.outputs.image-with-tag }}"
|
|
|
|
- name: Check images created
|
|
run: buildah images | grep '${{ env.IMAGE_NAME }}'
|
|
|
|
- name: Check manifest
|
|
run: |
|
|
set -x
|
|
buildah manifest inspect ${{ steps.build_image_multiarch.outputs.image }}:${{ env.IMAGE_TAG }} |