Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BuildPublishDocker workflow file #58

Merged
merged 1 commit into from
Oct 7, 2024
Merged
Show file tree
Hide file tree
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
44 changes: 44 additions & 0 deletions .github/workflows/BuildPublishDocker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Build and publish the docker image
on:
push:
tags:
- 'v*'
jobs:
build-and-push-image:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- image: ghcr.io/marshallwace/kafkakewl-deploy
dockerfile: ./Dockerfile-kafkakewl-deploy
- image: ghcr.io/marshallwace/kafkakewl-metrics
dockerfile: ./Dockerfile-kafkakewl-metrics
permissions:
contents: read
packages: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Login to ghcr.io
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extracting metadata for the image
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ matrix.image }}
tags: |
type=ref,event=pr
type=semver,pattern={{version}}
- name: Build and Push tag
uses: docker/build-push-action@v5
with:
context: .
file: ${{ matrix.dockerfile }}
platforms: linux/amd64
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
push: true
14 changes: 14 additions & 0 deletions Dockerfile-kafkakewl-deploy
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM eclipse-temurin:21-jdk-ubi9-minimal

# install some packages
RUN INSTALL_PKGS="findutils net-tools" \
&& microdnf install -y $INSTALL_PKGS \
&& rpm -V $INSTALL_PKGS \
&& microdnf clean all -y

# building, testing, packaging
COPY . /usr/src/app
WORKDIR /usr/src/app
RUN ./gradlew build

ENTRYPOINT ["java", "-jar", "kafkakewl-deploy/build/libs/kafkakewl-deploy-all.jar"]
14 changes: 14 additions & 0 deletions Dockerfile-kafkakewl-metrics
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM eclipse-temurin:21-jdk-ubi9-minimal

# install some packages
RUN INSTALL_PKGS="findutils net-tools" \
&& microdnf install -y $INSTALL_PKGS \
&& rpm -V $INSTALL_PKGS \
&& microdnf clean all -y

# building, testing, packaging
COPY . /usr/src/app
WORKDIR /usr/src/app
RUN ./gradlew build

ENTRYPOINT ["java", "-jar", "kafkakewl-metrics/build/libs/kafkakewl-metrics-all.jar"]
Loading