Skip to content

Commit 97d9c6e

Browse files
committed
#39 [docker public hub] fix: update workflow config
1 parent f1d4d54 commit 97d9c6e

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

.github/workflows/php-docker-public.yml

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,17 @@ jobs:
4747
username: ${{ env.DOCKERHUB_USERNAME }}
4848
password: ${{ env.DOCKERHUB_TOKEN }}
4949

50+
- name: Extract Docker metadata
51+
id: meta
52+
uses: docker/metadata-action@v5
53+
with:
54+
images: ${{ env.DOCKERHUB_USERNAME }}/${{ env.IMAGE_NAME }}
55+
tags: |
56+
type=ref,event=branch
57+
type=ref,event=tag
58+
type=semver,pattern={{version}}
59+
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' }}
60+
5061
- name: Get latest version tag
5162
id: get_version
5263
run: |
@@ -94,8 +105,11 @@ jobs:
94105
with:
95106
images: ${{ env.DOCKERHUB_USERNAME }}/${{ env.IMAGE_NAME }}
96107
tags: |
97-
type=latest
98-
type=${{ steps.inc_version.outputs.new_version }}
108+
type=ref,event=branch
109+
type=ref,event=tag
110+
type=semver,pattern={{version}}
111+
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' }}
112+
type=raw,value=${{ steps.inc_version.outputs.new_version }}
99113
100114
- name: Build and push Docker image
101115
id: build-and-push

0 commit comments

Comments
 (0)