Skip to content

Build and push - pipeline image #7

Build and push - pipeline image

Build and push - pipeline image #7

name: Build and push - pipeline image
on:
workflow_dispatch:
env:
PROJECT_DIR: "."
jobs:
build-and-push-image:
name: Build and Push container image
runs-on: ubuntu-latest
strategy:
matrix:
include:
- name: rec-sys-workflow
context: .
image-name: rec-sys-workflow
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to Quay.io
uses: docker/login-action@v3
with:
registry: quay.io
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_PASSWORD }}
- name: Set version from last commit hash
id: version
run: |
echo "tag=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
- name: Build and push ${{ matrix.name }}
uses: docker/build-push-action@v5
with:
context: ${{ matrix.context }}
file: Containerfile
push: true
tags: |
quay.io/rh-ai-kickstart/${{ matrix.image-name }}:${{ steps.version.outputs.tag }}
quay.io/rh-ai-kickstart/${{ matrix.image-name }}:latest
build-args: |
IMAGE_TAG=${{ steps.version.outputs.tag }}