Skip to content

Build and Push Container images #14

Build and Push Container images

Build and Push Container images #14

name: Build and Push Container images
env:
IMAGE_BASE_NAME: quay.io/rhappsvcs/spring-to-quarkus-mta-cli
MTA_VERSION: 6.3.8.Final
LATEST_IMAGE_TAG: latest
on:
workflow_dispatch:
inputs:
tag_latest:
description: Tag as "latest"?
required: false
type: boolean
concurrency:
group: "workflow = ${{ github.workflow }}, ref = ${{ github.event.workflow_run.head_branch || github.event.ref || github.ref }}"
cancel-in-progress: false
jobs:
build-push-images:
if: (github.event_name == 'workflow_dispatch') && (github.repository == 'RedHat-Middleware-Workshops/spring-to-quarkus-mta-cli')
runs-on: ubuntu-latest
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: arm64
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
install: true
- name: Login to quay
uses: docker/login-action@v3
with:
registry: quay.io
username: ${{ secrets.QUAY_REPO_USERNAME }}
password: ${{ secrets.QUAY_REPO_TOKEN }}
- name: Create container tags
run: echo "CONTAINER_TAGS=${{ env.IMAGE_BASE_NAME }}:${{ env.MTA_VERSION }}" >> $GITHUB_ENV
- name: Create latest container tag
if: ${{ inputs.tag_latest }}
run: echo "CONTAINER_TAGS=${{ env.CONTAINER_TAGS }},${{ env.IMAGE_BASE_NAME }}:${{ env.LATEST_IMAGE_TAG }}" >> $GITHUB_ENV
- name: Build and push images
uses: docker/build-push-action@v6
with:
platforms: linux/amd64,linux/arm64
push: true
load: false
tags: ${{ env.CONTAINER_TAGS }}