Skip to content
Open
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
45 changes: 44 additions & 1 deletion .github/workflows/build-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,47 @@ jobs:
VERSION=${{ github.ref_name }}
echo IMAGE_ID=$IMAGE_ID
echo VERSION=$VERSION
docker push $IMAGE_ID:$VERSION
docker push $IMAGE_ID:$VERSION
build-native:
runs-on: ubuntu-latest
# Configure your build (see README for more information)
env:
APP_NAME: kafka-synth-client
permissions:
contents: write
packages: write

steps:
- uses: actions/checkout@v3
- name: Set up JDK 21
uses: actions/setup-java@v3
with:
java-version: '21'
distribution: 'graalvm'
cache: maven
- name: Run Unit Tests
run: mvn clean test
- name: Build Container Image
run: |
IMAGE_NAME=${{ github.repository_owner }}/$APP_NAME
IMAGE_ID=ghcr.io/$IMAGE_NAME
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')
VERSION="${{ github.ref_name }}-native"

mvn package -DskipTests -Dnative -Dquarkus.native.container-build=true
docker build -t $IMAGE_ID:$VERSION . -f src/main/docker/Dockerfile.native
- name: Push Image
run: |
# Log in to registry
echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin
docker images

IMAGE_NAME=${{ github.repository_owner }}/$APP_NAME
IMAGE_ID=ghcr.io/$IMAGE_NAME

# Change all uppercase to lowercase
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')
VERSION="${{ github.ref_name }}-native"
echo IMAGE_ID=$IMAGE_ID
echo VERSION=$VERSION
docker push $IMAGE_ID:$VERSION