Skip to content

Add workflow to add new git tags to images on quay.io (#221) #3

Add workflow to add new git tags to images on quay.io (#221)

Add workflow to add new git tags to images on quay.io (#221) #3

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
steps:
- uses: actions/checkout@v4
# https://github.com/redhat-actions/buildah-build#readme
- 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 }}