Red Hat Konflux update deliverest #169
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }}" | |