Skip to content

Commit f53499c

Browse files
committed
fix: support manually created tags in test deployment workflow
1 parent 661e343 commit f53499c

File tree

1 file changed

+7
-14
lines changed

1 file changed

+7
-14
lines changed

.github/workflows/deploy-to-test.yaml

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -95,22 +95,15 @@ jobs:
9595
openshift_token: ${{ secrets.OPENSHIFT_TOKEN }}
9696
namespace: ${{ env.OPENSHIFT_NAMESPACE_TOOLS }}
9797

98-
- name: Tag ci-latest as version (if new deployment)
99-
if: needs.validate.outputs.tag_exists == 'false'
98+
- name: Check if image exists and tag if needed
10099
run: |
101-
echo "Tagging ci-latest as ${{ inputs.version }}..."
102-
oc -n ${{ env.OPENSHIFT_NAMESPACE_TOOLS }} tag \
103-
${{ env.IMAGE_NAME }}:ci-latest ${{ env.IMAGE_NAME }}:${{ inputs.version }}
104-
105-
- name: Verify image tag exists (if rollback)
106-
if: needs.validate.outputs.tag_exists == 'true'
107-
run: |
108-
echo "Verifying image tag ${{ inputs.version }} exists..."
109-
if ! oc -n ${{ env.OPENSHIFT_NAMESPACE_TOOLS }} get imagestreamtag ${{ env.IMAGE_NAME }}:${{ inputs.version }} &>/dev/null; then
110-
echo "Error: Image tag ${{ inputs.version }} does not exist"
111-
exit 1
100+
if oc -n ${{ env.OPENSHIFT_NAMESPACE_TOOLS }} get imagestreamtag ${{ env.IMAGE_NAME }}:${{ inputs.version }} &>/dev/null; then
101+
echo "Image tag ${{ inputs.version }} already exists - using existing image"
102+
else
103+
echo "Image tag ${{ inputs.version }} does not exist - tagging from ci-latest"
104+
oc -n ${{ env.OPENSHIFT_NAMESPACE_TOOLS }} tag \
105+
${{ env.IMAGE_NAME }}:ci-latest ${{ env.IMAGE_NAME }}:${{ inputs.version }}
112106
fi
113-
echo "Image tag ${{ inputs.version }} found - proceeding with rollback"
114107
115108
- name: Tag version as test
116109
run: |

0 commit comments

Comments
 (0)