Skip to content

Commit c7c14f2

Browse files
committed
feat: tag and flavor docker meta config
1 parent e192749 commit c7c14f2

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

.github/workflows/maven-bump-push-dockerhub.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,7 @@ jobs:
1616
build:
1717
name: Maven Build
1818
runs-on: ubuntu-latest
19-
environment:
20-
name: Build # To isolate BUMP_PAT
21-
url: ${{ steps.upload.outputs.artifact-url }}
19+
environment: Build # To contain BUMP_PAT within an environment
2220
outputs:
2321
artifact_name: app-${{ steps.semver.outputs.nextStrict }}
2422
new_tag: ${{ steps.semver.outputs.nextStrict }}
@@ -74,15 +72,13 @@ jobs:
7472
version: ${{ steps.semver.outputs.nextStrict }}
7573

7674
- name: Upload JAR Artifact
77-
id: upload
7875
uses: actions/upload-artifact@v4
7976
with:
8077
name: ${{ github.event.repository.name }}-${{ steps.semver.outputs.nextStrict }}
8178
path: target/*.jar
8279
if-no-files-found: error
8380

8481
- name: Upload Coverage Report Artifact
85-
id: upload
8682
uses: actions/upload-artifact@v4
8783
with:
8884
name: ${{ github.event.repository.name }}-${{ steps.semver.outputs.nextStrict }}-coverage-report
@@ -105,7 +101,7 @@ jobs:
105101
uses: actions/download-artifact@v4
106102
with:
107103
name: ${{ needs.build.outputs.artifact_name }}
108-
path: target/*.jar
104+
path: target
109105

110106
- name: Login to Docker Hub
111107
uses: docker/login-action@v3
@@ -117,12 +113,16 @@ jobs:
117113
id: meta
118114
uses: docker/metadata-action@v3
119115
with:
120-
images: ${{ inputs.dockerhub_username }}/${{ github.event.repository.name }}
116+
images: ${{ inputs.image_name }}
117+
flavor: |
118+
latest=true
119+
tags: |
120+
type=semver,pattern={{version}},value=${{ needs.build.outputs.new_tag }}
121121
labels: |
122122
org.opencontainers.image.authors=${{ github.event.repository.owner.html_url }}#group-members
123123
org.opencontainers.image.title=${{ github.event.repository.name }}
124124
org.opencontainers.image.description=${{ github.event.repository.description }}
125-
org.opencontainers.image.url=https://hub.docker.com/r/${{ inputs.dockerhub_username }}/${{ github.event.repository.name }}
125+
org.opencontainers.image.url=https://hub.docker.com/r/${{ inputs.image_name }}
126126
org.opencontainers.image.documentation=${{ github.event.repository.html_url }}/wiki
127127
org.opencontainers.image.source=${{ github.event.repository.html_url }}
128128
org.opencontainers.image.version=${{ needs.build.outputs.new_tag }}

0 commit comments

Comments
 (0)