File tree Expand file tree Collapse file tree 1 file changed +10
-5
lines changed
Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -71,24 +71,29 @@ jobs:
7171 git config --global user.name "${{ secrets.GIT_USER_NAME }}"
7272 git config --global user.email "${{ secrets.GIT_USER_EMAIL }}"
7373
74- - name : Update image tag
74+ - name : Update image tag and push to branch
7575 run : |
7676 if [ -z "$IMAGE_TAG" ]; then
77- echo " IMAGE_TAG is empty, exiting."
77+ echo "IMAGE_TAG is empty, exiting."
7878 exit 1
7979 fi
8080
81+ git fetch origin auto/kustomize-update || true
82+ git pull origin auto/kustomize-update --rebase || true
83+
8184 FILE="kustomize/overlays/dev/patch-deployment-image.yaml"
8285 echo "Updating $FILE with image: $IMAGE_NAME:$IMAGE_TAG"
8386
8487 sed -i.bak -E "s|image:.*|image: ${IMAGE_NAME}:${IMAGE_TAG}|" "$FILE"
8588
8689 git add "$FILE"
87- git commit -m "Update image tag to $IMAGE_TAG"
88-
89- git push origin HEAD:auto/kustomize-update --force-with-lease
90+ git commit -m "Update image tag to $IMAGE_TAG" || echo "No changes to commit"
9091
9192
93+ git push origin HEAD:auto/kustomize-update --force-with-lease
94+ env :
95+ IMAGE_NAME : yourdockerhub/springboot-postgres
96+ IMAGE_TAG : ${{ needs.build-and-push.outputs.image-tag }}
9297
9398
9499
You can’t perform that action at this time.
0 commit comments