From 5de2cb7192807c05e1401e67e40dfb4e1e16d803 Mon Sep 17 00:00:00 2001 From: Alex Maltsev Date: Thu, 22 Aug 2024 13:32:47 +0300 Subject: [PATCH] Workflows: Fixed GHCR workflow. (#3398) --- .github/workflows/docker-image-publish.yml | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/.github/workflows/docker-image-publish.yml b/.github/workflows/docker-image-publish.yml index 4249a8370a9..286b03d03d3 100644 --- a/.github/workflows/docker-image-publish.yml +++ b/.github/workflows/docker-image-publish.yml @@ -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 @@ -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: