Skip to content

Add workflows for building and pushing container image (#218) #1

Add workflows for building and pushing container image (#218)

Add workflows for building and pushing container image (#218) #1

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
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 }}