Skip to content
Merged
16 changes: 14 additions & 2 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
name: Build container image
on:
pull_request:
push:
tags:
- '*'

env:
IMAGE_NAME: ${{ github.event.repository.name }}
IMAGE_TAGS: ${{ github.sha }}

jobs:
build:
Expand All @@ -25,8 +27,18 @@ jobs:
uses: redhat-actions/buildah-build@v2
with:
image: ${{ env.IMAGE_NAME }}
tags: ${{ env.IMAGE_TAGS }}
tags: ${{ github.event_name == 'pull_request' && github.sha || github.ref_name }}
archs: amd64, arm64, ppc64le, riscv64, s390x
containerfiles: |
./Dockerfile

- name: Push To Registry
if: github.event_name == 'push' && github.ref_type == 'tag'
uses: redhat-actions/push-to-registry@v2
id: push_image
with:
image: ${{ steps.build_image.outputs.image }}
tags: ${{ steps.build_image.outputs.tags }}
registry: ${{ vars.IMAGE_REGISTRY }}/${{ vars.IMAGE_NAMESPACE }}
username: ${{ secrets.REGISTRY_USER }}
password: ${{ secrets.REGISTRY_PASSWORD }}
44 changes: 0 additions & 44 deletions .github/workflows/build_and_push.yaml

This file was deleted.