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

Github actions: fix github container registry workflow #3398

Merged
merged 1 commit into from
Aug 22, 2024
Merged
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
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
Loading