Skip to content

Commit

Permalink
Workflows: Fixed GHCR workflow. (#3398)
Browse files Browse the repository at this point in the history
  • Loading branch information
And1sS authored Aug 22, 2024
1 parent b8dac64 commit 5de2cb7
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions .github/workflows/docker-image-publish.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
name: Publish Docker image for new tag/release

on:
workflow_run:
workflows: [Publish release]
types:
- completed
push:
tags:
- '*'

env:
REGISTRY: ghcr.io
Expand All @@ -20,36 +19,42 @@ jobs:
strategy:
matrix:
java: [ 21 ]
dockerfile-path: [Dockerfile, extra/Dockerfile]
dockerfile-path: [Dockerfile, Dockerfile-modules]
include:
- dockerfile-path: Dockerfile
build-cmd: mvn clean package -Dcheckstyle.skip -Dmaven.test.skip=true
package-name: ghcr.io/${{ github.repository }}
- dockerfile-path: extra/Dockerfile

- dockerfile-path: Dockerfile-modules
build-cmd: mvn clean package --file extra/pom.xml -Dcheckstyle.skip -Dmaven.test.skip=true
package-name: ghcr.io/${{ github.repository }}-bundle
steps:
- name: Check out Repository
uses: actions/checkout@v4

- name: Set up JDK
uses: actions/setup-java@v3
with:
distribution: 'temurin'
cache: 'maven'
java-version: ${{ matrix.java }}

- name: Build .jar via Maven
run: ${{ matrix.build-cmd }}
- name: Checkout repository
uses: actions/checkout@v4

- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker Image
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ matrix.package-name }}

- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
Expand Down

0 comments on commit 5de2cb7

Please sign in to comment.