Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions .github/workflows/docker-build-push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Build and Push Docker Images

on:
workflow_dispatch:
inputs:
image:
description: "Select the image type to build"
required: true
type: choice
options:
- cpu
- gpu
tag:
description: "Docker image tag (e.g., latest, 2.53.0)"
required: true
type: string

jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Log in to cerit.io
uses: docker/login-action@v3
with:
registry: cerit.io
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_PASSWORD }}

- name: Determine exact image tag
id: set_tag
run: |
# Automatically append '-gpu' suffix for GPU images if not already present
if [ "${{ inputs.image }}" = "gpu" ] && [[ "${{ inputs.tag }}" != *"-gpu" ]]; then
echo "image_tag=${{ inputs.tag }}-gpu" >> $GITHUB_OUTPUT
else
echo "image_tag=${{ inputs.tag }}" >> $GITHUB_OUTPUT
fi

- name: Build and push image
uses: docker/build-push-action@v5
with:
context: .
file: ./docker/Dockerfile.${{ inputs.image }}
push: true
tags: cerit.io/rationai/model-service:${{ steps.set_tag.outputs.image_tag }}
Loading