Skip to content

Update build.yaml

Update build.yaml #124

Workflow file for this run

name: Build and Push Multi-Arch Image with Buildah
on:
push:
branches:
- main
release:
types:
- published
workflow_dispatch:
env:
IMAGE_NAME: quay.io/kuadrant/console-plugin
jobs:
build:
name: Build Multi-Arch Image with Buildah
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
arch: [amd64, arm64]
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Install QEMU
run: |
sudo apt-get update
sudo apt-get install -y qemu-user-static
- name: Build Image for Main Branch
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
uses: redhat-actions/buildah-build@v2
with:
image: ${{ env.IMAGE_NAME }}
tags: |
latest
${{ github.sha }}
archs: ${{ matrix.arch }}
containerfiles: |
./Dockerfile
- name: Build Image for Release
if: github.event_name == 'release' && github.event.action == 'published'
uses: redhat-actions/buildah-build@v2
with:
image: ${{ env.IMAGE_NAME }}
tags: |
${{ github.event.release.name }}
archs: ${{ matrix.arch }}
containerfiles: |
./Dockerfile
- name: Push Images
if: always()
uses: redhat-actions/push-to-registry@v2
with:
registry: quay.io
username: ${{ secrets.QUAY_USER }}
password: ${{ secrets.QUAY_PASSWORD }}