clickhouse-sink-connector/.github/workflows/unit_test_docker_image.yml
2023-04-04 13:29:46 -04:00

36 lines
1.1 KiB
YAML

name: Build, Unit tests, Push Docker image.
on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main, develop ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v2
with:
java-version: '11'
distribution: 'temurin'
cache: maven
- name: Build with Maven
working-directory: sink-connector
run: mvn -B package --file pom.xml
- name: Run Unit tests
working-directory: sink-connector
run: mvn test -Dgroups=IntegrationTest --file pom.xml
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build the Docker image
working-directory: sink-connector
run: docker build . --file docker/Dockerfile-sink-on-debezium-base-image --tag altinity/clickhouse-sink-connector:$(date +%F)
- name: Push docker image to dockerhub
working-directory: sink-connector
run: docker push altinity/clickhouse-sink-connector:$(date +%F)