Skip to content

Commit 7fbe7b4

Browse files
committed
⚙️ fixed: dynamic create docker image with tag and not tag.
1 parent 82e42db commit 7fbe7b4

1 file changed

Lines changed: 7 additions & 8 deletions

File tree

.github/workflows/build.yml

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,23 +47,22 @@ jobs:
4747
id: date
4848
run: echo "name=$(date +'%m-%d-%Y')" >> $GITHUB_OUTPUT
4949

50-
- name: Build the ddeutil-workflow Docker image latest
50+
- name: Build the ddeutil-workflow Docker image without tag
51+
if: github.ref_type == 'tag'
5152
run: |
5253
docker buildx build \
5354
--file ./.container/Dockerfile \
5455
--platform linux/amd64,linux/arm64 \
55-
--tag ${{ vars.GH_REPO_URL }}:latest .
56-
57-
docker push ${{ vars.GH_REPO_URL }}:latest
56+
--tag ${{ vars.GH_REPO_URL }}:latest \
57+
--push .
5858
5959
- name: Build the ddeutil-workflow Docker image with tag
6060
if: github.ref_type == 'tag'
6161
run: |
6262
TAG=$(echo ${GITHUB_REF#refs/tags/} | tr "[:upper:]" "[:lower:]" | sed -e 's/v//g')
63-
echo $TAG
6463
docker buildx build \
6564
--file ./.container/Dockerfile \
6665
--platform linux/amd64,linux/arm64 \
67-
--tag ${{ vars.GH_REPO_URL }}:$TAG .
68-
69-
docker push --tag ${{ vars.GH_REPO_URL }}:$TAG
66+
--tag ${{ vars.GH_REPO_URL }}:$TAG \
67+
--tag ${{ vars.GH_REPO_URL }}:latest \
68+
--push .

0 commit comments

Comments
 (0)