Skip to content

Commit 63e7f66

Browse files
committed
chore: refactor Docker image workflow to streamline tag handling and remove redundant environment variables
1 parent 791de5e commit 63e7f66

1 file changed

Lines changed: 4 additions & 6 deletions

File tree

.github/workflows/reusable-publish-image.yml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,6 @@ on:
4141
env:
4242
REGISTRY: ghcr.io
4343
IMAGE_NAME: ${{ inputs.registryImage || github.repository }}
44-
LATEST_TAG: ${{ inputs.registryImage || github.repository }}:${{ inputs.tag }}
45-
HASH_TAG: ${{ inputs.registryImage || github.repository }}:${{ inputs.commitHash || github.sha }}
4644

4745
jobs:
4846
build:
@@ -89,9 +87,6 @@ jobs:
8987
file: ${{ inputs.dockerFile }}
9088
platforms: ${{ matrix.platform }}
9189
labels: ${{ steps.meta.outputs.labels }}
92-
tags: |
93-
${{ env.LATEST_TAG }}
94-
${{ env.HASH_TAG }}
9590
outputs: type=image,name=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }},push-by-digest=true,name-canonical=true,push=true
9691

9792
- name: Export digest
@@ -128,6 +123,9 @@ jobs:
128123
uses: docker/metadata-action@v5
129124
with:
130125
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
126+
tags: |
127+
type=raw,value=${{ inputs.tag }}
128+
type=raw,value=${{ inputs.commitHash || github.sha }}
131129
132130
- name: Login to GitHub Container Registry
133131
uses: docker/login-action@v3.6.0
@@ -144,4 +142,4 @@ jobs:
144142
145143
- name: Inspect image
146144
run: |
147-
docker buildx imagetools inspect ${{ env.LATEST_TAG }}
145+
docker buildx imagetools inspect ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ inputs.tag }}

0 commit comments

Comments
 (0)