From f5b3cbbb0d0521330433b7aa304f36a02032a3e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mat=C4=9Bj=20Pek=C3=A1r?= Date: Wed, 11 Mar 2026 18:11:16 +0100 Subject: [PATCH 1/2] feat: docker workflow --- .github/workflows/docker-build-push.yml | 51 +++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 .github/workflows/docker-build-push.yml diff --git a/.github/workflows/docker-build-push.yml b/.github/workflows/docker-build-push.yml new file mode 100644 index 0000000..dd4cb1f --- /dev/null +++ b/.github/workflows/docker-build-push.yml @@ -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, 2.53.0-gpu)" + 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 }} From 732fa7f011504cc9c87afd28634af36859f3d26e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mat=C4=9Bj=20Pek=C3=A1r?= Date: Wed, 11 Mar 2026 18:14:55 +0100 Subject: [PATCH 2/2] fix: tags --- .github/workflows/docker-build-push.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker-build-push.yml b/.github/workflows/docker-build-push.yml index dd4cb1f..a8749f8 100644 --- a/.github/workflows/docker-build-push.yml +++ b/.github/workflows/docker-build-push.yml @@ -11,7 +11,7 @@ on: - cpu - gpu tag: - description: "Docker image tag (e.g., latest, 2.53.0, 2.53.0-gpu)" + description: "Docker image tag (e.g., latest, 2.53.0)" required: true type: string