Skip to content

fixup build-and-push (#219) #2

fixup build-and-push (#219)

fixup build-and-push (#219) #2

name: Build and push container image
env:
IMAGE_NAME: "rapidast"
IMAGE_TAGS: "${{ github.sha }}"
IMAGE_REGISTRY: quay.io/redhatproductsecurity
IMAGE_REGISTRY_USER: ${{ secrets.IMAGE_REGISTRY_USER }}
IMAGE_REGISTRY_PASSWORD: ${{ secrets.IMAGE_REGISTRY_PASSWORD }}
on:
push:
branches: ["development", "main"]
jobs:
build-and-push:
runs-on: ubuntu-latest
# https://github.com/redhat-actions/buildah-build#readme
steps:
- uses: actions/checkout@v4
- name: Build container image
id: build-image
uses: redhat-actions/buildah-build@v2
with:
image: ${{ env.IMAGE_NAME }}
tags: ${{ env.IMAGE_TAGS }}
dockerfiles: |
./containerize/Containerfile
# https://github.com/redhat-actions/push-to-registry#readme
- name: Push to registry
id: push-image
uses: redhat-actions/push-to-registry@v2
with:
image: ${{ steps.build-image.outputs.image }}
tags: ${{ steps.build-image.outputs.tags }}
registry: ${{ env.IMAGE_REGISTRY }}
username: ${{ env.IMAGE_REGISTRY_USER }}
password: ${{ env.IMAGE_REGISTRY_PASSWORD }}