-
Notifications
You must be signed in to change notification settings - Fork 5
56 lines (47 loc) · 1.42 KB
/
build-oci.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
name: oci-build
on:
push:
branches: [ main ]
tags:
- '*'
pull_request:
branches: [ main ]
jobs:
build-deliverest:
name: build-deliverest
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Pick image tag on non pull-request
if: github.event_name != 'pull_request'
shell: bash
run: echo "TAG=${{ GITHUB.REF_NAME}}" >> $GITHUB_ENV
- name: Pick image tag on pull-request
if: github.event_name == 'pull_request'
shell: bash
run: echo "TAG=${{ GITHUB.EVENT.PULL_REQUEST.HEAD.REF}}" >> $GITHUB_ENV
- name: Build image
id: build-image
uses: redhat-actions/[email protected]
with:
image: deliverest
tags: ${{ env.TAG }}
context: .
containerfiles: |
Containerfile
- name: Log in to quay.io Registry
uses: redhat-actions/[email protected]
with:
registry: quay.io
username: ${{ secrets.QUAY_IO_USERNAME }}
password: ${{ secrets.QUAY_IO_PASSWORD }}
- name: Push to quay.io
id: push-to-quay
uses: redhat-actions/[email protected]
with:
image: ${{ steps.build-image.outputs.image }}
tags: ${{ steps.build-image.outputs.tags }}
registry: quay.io/rhqp
- name: Print image url
run: echo "Image pushed to ${{ steps.push-to-quay.outputs.registry-paths }}"