Skip to content

Commit f5cbe20

Browse files
authored
fix: Update docker.yml (#4736)
1 parent f3946ac commit f5cbe20

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

.github/workflows/docker.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,12 @@ on:
44
push:
55
branches:
66
- 3.x
7-
release:
8-
types: [published]
97

108
jobs:
119
push_to_registry:
1210
name: Build and push Docker image to Docker Hub
1311
runs-on: ubuntu-22.04
12+
if: startsWith(github.event.ref_name, 'release-')
1413

1514
steps:
1615
- name: Check out the repo with the latest code
@@ -27,7 +26,11 @@ jobs:
2726

2827
- name: Get the current tag
2928
id: currentTag
30-
run: git fetch --prune --unshallow && TAG=$(git describe --tags --abbrev=0) && echo $TAG && echo "TAG="$TAG >> "$GITHUB_ENV"
29+
run: |
30+
git fetch --prune --unshallow
31+
TAG=$(git describe --tags --abbrev=0)
32+
echo $TAG
33+
echo "TAG=$TAG" >> $GITHUB_ENV
3134
3235
- name: Build and push Docker image
3336
uses: docker/build-push-action@v6
@@ -36,4 +39,4 @@ jobs:
3639
push: true
3740
tags: |
3841
${{ secrets.DOCKERHUB_REPOSITORY }}:latest
39-
${{ secrets.DOCKERHUB_REPOSITORY }}:${{ env.TAG }}
42+
${{ secrets.DOCKERHUB_REPOSITORY }}:${{ env.TAG }}

0 commit comments

Comments
 (0)