Skip to content

Commit 528ab96

Browse files
authored
chore(CI): Use metadata action to prevent env errors (#68)
1 parent e07b114 commit 528ab96

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

.github/workflows/temp-release.yml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ on:
44
workflow_dispatch:
55
inputs:
66
name:
7-
description: Docker image tag to apply to the image (e.g., debug-version)
7+
description: Docker image tag to apply to the image
88
required: true
99

1010
env:
1111
REGISTRY: ghcr.io
12-
IMAGE_NAME: ${{ github.repository | toLower() }}
12+
IMAGE_NAME: ${{ github.repository }}
1313

1414
jobs:
1515
build:
@@ -35,12 +35,20 @@ jobs:
3535
username: ${{ github.actor }}
3636
password: ${{ secrets.GITHUB_TOKEN }}
3737

38-
- name: Build and push Docker image with custom tag
38+
- name: Extract metadata (tags, labels) for Docker
39+
id: meta
40+
uses: docker/metadata-action@v5
41+
with:
42+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
43+
tags: ${{ github.event.inputs.name }}
44+
45+
- name: Build and push Docker image
3946
uses: docker/build-push-action@v6
4047
env:
4148
DOCKER_BUILD_SUMMARY: false
4249
with:
4350
context: .
4451
push: true
4552
platforms: linux/amd64,linux/arm64
46-
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.event.inputs.name | toLower() }}
53+
tags: ${{ steps.meta.outputs.tags }}
54+
labels: ${{ steps.meta.outputs.labels }}

0 commit comments

Comments
 (0)