Update build.yaml #123
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and Push Multi-Arch Image | |
on: | |
push: | |
branches: | |
- main | |
release: | |
types: | |
- published | |
workflow_dispatch: | |
env: | |
REGISTRY_USER: ${{ secrets.QUAY_USER }} | |
REGISTRY_PASSWORD: ${{ secrets.QUAY_PASSWORD }} | |
IMAGE_NAME: quay.io/kuadrant/console-plugin | |
jobs: | |
build-multiarch: | |
name: Build Multi-Arch Image with Buildah | |
runs-on: ubuntu-22.04 | |
strategy: | |
fail-fast: false | |
matrix: | |
arch: [amd64, arm64] | |
install_latest: [true, false] | |
steps: | |
- name: Set up QEMU for multi-arch | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y qemu-user-static | |
- name: Install latest Buildah | |
if: matrix.install_latest | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y buildah | |
- name: Check out code | |
uses: actions/checkout@v4 | |
- name: Log in to Quay.io | |
uses: redhat-actions/podman-login@v1 | |
with: | |
registry: quay.io | |
username: ${{ secrets.QUAY_USER }} | |
password: ${{ secrets.QUAY_PASSWORD }} | |
- name: Build Multi-Arch Image | |
id: build_image | |
uses: redhat-actions/buildah-build@v2 | |
with: | |
image: ${{ env.IMAGE_NAME }} | |
tags: | | |
latest | |
${{ github.sha }} | |
arch: ${{ matrix.arch }} | |
containerfiles: | | |
./Dockerfile | |
- name: Push Multi-Arch Manifest | |
if: matrix.arch == 'arm64' | |
uses: redhat-actions/push-to-registry@v2 | |
with: | |
image: ${{ env.IMAGE_NAME }} | |
tags: | | |
latest | |
${{ github.sha }} | |
- name: Print Image Info | |
run: | | |
echo "Image pushed to Quay.io: ${{ env.IMAGE_NAME }}" | |
echo "Tags: latest, ${{ github.sha }}" |