generated from openshift/console-plugin-template
-
Notifications
You must be signed in to change notification settings - Fork 2
45 lines (37 loc) · 1.18 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
name: Build and Push Image
on:
push:
branches:
- main # This ensures the action only runs on pushes to the main branch
env:
REGISTRY_USER: ${{ secrets.QUAY_USER }}
IMAGE_REGISTRY: quay.io
REGISTRY_PASSWORD: ${{ secrets.QUAY_PASSWORD }}
jobs:
build:
name: Build and push image
runs-on: ubuntu-22.04
steps:
- name: Log in to Quay.io
uses: redhat-actions/podman-login@v1
with:
username: ${{ env.REGISTRY_USER }}
password: ${{ env.REGISTRY_PASSWORD }}
registry: ${{ env.IMAGE_REGISTRY }}
- uses: actions/checkout@v4
- name: Build Image
id: build-image
uses: redhat-actions/buildah-build@v2
with:
image: quay.io/kuadrant/console-plugin
tags: latest,${{ github.sha }}
containerfiles: |
./Dockerfile
- name: Push To Quay.io
id: push-to-quay
uses: redhat-actions/push-to-registry@v2
with:
image: ${{ steps.build-image.outputs.image }}
tags: ${{ steps.build-image.outputs.tags }}
- name: Print image URL
run: echo "Image pushed to ${{ steps.push-to-quay.outputs.registry-paths }}"