Skip to content

Add cifmw client container #12

Add cifmw client container

Add cifmw client container #12

name: Build and Push Image
on: [ push ]
env:
IMAGE_NAME: cifmw-client
IMAGE_REGISTRY: quay.rdoproject.org/ci-framework
REGISTRY_USER: ${{ secrets.QUAY_USERNAME }}
REGISTRY_PASSWORD: ${{ secrets.QUAY_PASSWORD }}
jobs:
build:
name: Build and push image
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Get branch name
id: branch-name
uses: tj-actions/branch-names@v7
# Overriding the LATEST_TAG var allows us to track latest
# tags for other branches, "latest" won't move unless code
# is merged into the main branch.
- name: Set latest tag for non main branch
if: "${{ steps.branch-name.outputs.current_branch != 'main' }}"
run: |
echo "LATEST_TAG=${{ steps.branch-name.outputs.current_branch }}-latest" >> $GITHUB_ENV
- name: Build Image
id: build-image
uses: redhat-actions/buildah-build@v2
with:
image: ${{ env.IMAGE_NAME }}
tags: ${{ env.LATEST_TAG }} ${{ github.sha }}
containerfiles: |
containerfiles/Containerfile.client
- name: Push To quay.rdoproject.org
id: push-to-quay
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.REGISTRY_USER }}
password: ${{ env.REGISTRY_PASSWORD }}
- name: Print image url
run: echo "Image pushed to ${{ steps.push-to-quay.outputs.registry-paths }}"