generated from openshift/console-plugin-template
-
Notifications
You must be signed in to change notification settings - Fork 4
67 lines (57 loc) · 2.04 KB
/
dev-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
63
64
65
66
67
name: Dev Build and Push
on:
push:
branches:
- main
workflow_dispatch:
env:
IMAGE_BASE_NAME: kuadrant/console-plugin
REGISTRY: quay.io
jobs:
build:
name: Build and Push Multi-Arch Image
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
id: build
uses: redhat-actions/buildah-build@v2
with:
image: ${{ env.REGISTRY }}/${{ env.IMAGE_BASE_NAME }}
tags: latest-${{ matrix.arch }}
archs: ${{ matrix.arch }}
containerfiles: |
./Dockerfile
- name: Push Architecture-Specific Image
uses: redhat-actions/push-to-registry@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ secrets.QUAY_USER }}
password: ${{ secrets.QUAY_PASSWORD }}
image: ${{ env.IMAGE_BASE_NAME }}
tags: latest-${{ matrix.arch }}
manifest:
name: Create and Push Multi-Arch Manifest
needs: build
runs-on: ubuntu-22.04
steps:
- name: Install Buildah
run: sudo apt-get update && sudo apt-get install -y buildah
- name: Create Manifest
run: |
buildah manifest create ${{ env.REGISTRY }}/${{ env.IMAGE_BASE_NAME }}:latest
buildah manifest add ${{ env.REGISTRY }}/${{ env.IMAGE_BASE_NAME }}:latest docker://${{ env.REGISTRY }}/${{ env.IMAGE_BASE_NAME }}:latest-amd64
buildah manifest add ${{ env.REGISTRY }}/${{ env.IMAGE_BASE_NAME }}:latest docker://${{ env.REGISTRY }}/${{ env.IMAGE_BASE_NAME }}:latest-arm64
- name: Push Multi-Arch Manifest
run: |
buildah manifest push --all ${{ env.REGISTRY }}/${{ env.IMAGE_BASE_NAME }}:latest docker://${{ env.REGISTRY }}/${{ env.IMAGE_BASE_NAME }}:latest \
--creds=${{ secrets.QUAY_USER }}:${{ secrets.QUAY_PASSWORD }}