generated from openshift/console-plugin-template
-
Notifications
You must be signed in to change notification settings - Fork 4
62 lines (54 loc) · 1.51 KB
/
build.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
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 }}