Skip to content

Commit ab0baa5

Browse files
Dominik Lenosienkeys
authored andcommitted
ADD GitHub Action for cli-java image build
1 parent ec4c4b4 commit ab0baa5

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed

.github/workflows/image_build.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Build and Push Image
2+
on:
3+
push:
4+
branches:
5+
- 'main'
6+
7+
env:
8+
IMAGE_NAME: cli-java
9+
IMAGE_REGISTRY: quay.io
10+
IMAGE_NAMESPACE: rhmessagingqe
11+
12+
jobs:
13+
build:
14+
name: Build and push image
15+
runs-on: ubuntu-22.04
16+
17+
steps:
18+
- uses: actions/checkout@v3
19+
20+
- name: Set up QEMU
21+
uses: docker/setup-qemu-action@v2
22+
23+
- name: Build Image
24+
id: build-image
25+
uses: redhat-actions/buildah-build@v2
26+
with:
27+
image: ${{ env.IMAGE_NAME }}
28+
tags: latest ${{ github.sha }} ${{ github.ref_name }}
29+
archs: amd64, arm64, ppc64le, s390x
30+
containerfiles: |
31+
./Dockerfile
32+
33+
- name: Push To quay.io
34+
id: push-to-quay
35+
uses: redhat-actions/push-to-registry@v2
36+
with:
37+
image: ${{ steps.build-image.outputs.image }}
38+
tags: ${{ steps.build-image.outputs.tags }}
39+
registry: ${{ env.IMAGE_REGISTRY }}/${{ env.IMAGE_NAMESPACE }}
40+
username: ${{ secrets.QUAY_USER }}
41+
password: ${{ secrets.QUAY_TOKEN }}
42+
43+
- name: Print images URL
44+
run: echo "Images pushed to ${{ steps.push-to-quay.outputs.registry-paths }}"

0 commit comments

Comments
 (0)