Skip to content

chore: [release-1.5] update dockerfile images (#2581) #2

chore: [release-1.5] update dockerfile images (#2581)

chore: [release-1.5] update dockerfile images (#2581) #2

name: Build & Push e2e-runner Image to Quay.io
on:
push:
branches:
- main
- release-1.**
paths:
- '.ibm/images/Dockerfile'
- '.yarnrc.yml'
workflow_dispatch:
inputs:
branch:
description: Target branch to build
required: true
default: 'NONE'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
REGISTRY: quay.io
REGISTRY_IMAGE: rhdh-community/rhdh-e2e-runner
jobs:
build-image:
name: Build & Push e2e-runner Image
strategy:
fail-fast: false
matrix:
os: [ubuntu-24.04]
runs-on: ${{ matrix.os }}
permissions:
contents: read
packages: write
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Prepare Environment Variables
run: |
echo "PLATFORM=linux/amd64" >> $GITHUB_ENV
# create image tag from the correct branch (either from a push or a workflow_dispatch trigger)
if [[ "${{ inputs.branch }}" ]] && [[ "${{ inputs.branch }}" != "NONE" ]]; then
echo "Switch to ${{ inputs.branch }}"
git checkout "${{ inputs.branch }}"
IMAGE_TAG="${{ inputs.branch }}"
else
echo "Use current branch ${{ github.ref }}"
IMAGE_TAG=$(git rev-parse --abbrev-ref HEAD)
fi
echo "Use IMAGE_TAG = $IMAGE_TAG"
echo "IMAGE_TAG=$IMAGE_TAG" >> $GITHUB_ENV
- name: Get the last commit short SHA
uses: ./.github/actions/get-sha
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Quay.io
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_TOKEN }}
- name: Build and Push Image
uses: docker/build-push-action@v5
with:
context: .
file: .ibm/images/Dockerfile
push: true
tags: |
${{ env.REGISTRY }}/${{ env.REGISTRY_IMAGE }}:${{ env.IMAGE_TAG }}
${{ env.REGISTRY }}/${{ env.REGISTRY_IMAGE }}:${{ env.IMAGE_TAG }}-${{ env.SHORT_SHA }}
platforms: ${{ env.PLATFORM }}