Skip to content

Commit

Permalink
Merge pull request #58 from MarshallWace/actions
Browse files Browse the repository at this point in the history
BuildPublishDocker workflow file
  • Loading branch information
mw-lb authored Oct 7, 2024
2 parents 74d7f4b + 1645806 commit de7b50a
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 0 deletions.
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"]

0 comments on commit de7b50a

Please sign in to comment.