Skip to content
This repository was archived by the owner on Jul 6, 2025. It is now read-only.

Merge pull request #95 from Zenfulcode/patch-adding-missing-configura… #45

Merge pull request #95 from Zenfulcode/patch-adding-missing-configura…

Merge pull request #95 from Zenfulcode/patch-adding-missing-configura… #45

name: Build and Push Docker Images to GHCR
on:
push:
branches:
- main
env:
REGISTRY: ghcr.io
jobs:
build-and-push:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GHCR_PAT }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ github.repository }}
tags: |
type=ref,event=branch
type=sha
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build JAR
run: mvn clean package -DskipTests -f pom.xml
- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}