Skip to content

Lecture04

Lecture04 #97

name: Build and push - service/kafka-connect
on:
push:
paths:
- "services/kafka-connect/**"
- ".github/workflows/**"
branches: ["main"]
tags: ["v*"]
pull_request:
branches: ["main"]
env:
USERNAME: jah
REGISTRY: registry.gitlab.sdu.dk
IMAGE_NAME: bigdatarepo/kafka-connect
CP_VERSION: "7.3.1"
jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ env.USERNAME }}
password: ${{ secrets.GITLAB_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push
uses: docker/build-push-action@v6
with:
context: "{{defaultContext}}:services/kafka-connect/"
build-args: "CP_VERSION=${{ env.CP_VERSION }}"
push: true
tags: |
${{ env.REGISTRY }}/${{ env.USERNAME }}/${{ env.IMAGE_NAME }}:${{ env.CP_VERSION }}
${{ env.REGISTRY }}/${{ env.USERNAME }}/${{ env.IMAGE_NAME }}:latest