-
Notifications
You must be signed in to change notification settings - Fork 167
36 lines (32 loc) · 1.07 KB
/
kafka-connect.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
name: Build & publish event-streams-samples images
on:
push:
branches: ['master']
paths:
- 'kafka-connect/**'
env:
REGISTRY: ghcr.io
jobs:
build-and-push-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Log in to registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin
- name: Run bash script
run: bash kafka-connect/build.sh
- name: Build image
run: |
docker build . --file kafka-connect/Dockerfile --tag eventstreams-kafka-connect:latest --label "latest"
- name: Push image
run: |
IMAGE_ID=ghcr.io/${{ github.repository }}/eventstreams-kafka-connect:latest
# This changes all uppercase characters to lowercase.
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')
echo IMAGE_ID=$IMAGE_ID
docker tag eventstreams-kafka-connect:latest $IMAGE_ID
docker push $IMAGE_ID