Skip to content

Commit dabdfc6

Browse files
committed
fix: support manually created tags in test deployment workflow
1 parent b8445dd commit dabdfc6

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
@@ -103,22 +103,15 @@ jobs:
103103
openshift_token: ${{ secrets.OPENSHIFT_TOKEN }}
104104
namespace: ${{ env.OPENSHIFT_NAMESPACE_TOOLS }}
105105

106-
- name: Tag ci-latest as version (if new deployment)
107-
if: needs.validate.outputs.tag_exists == 'false'
106+
- name: Check if image exists and tag if needed
108107
run: |
109-
echo "Tagging ci-latest as ${{ inputs.version }}..."
110-
oc -n ${{ env.OPENSHIFT_NAMESPACE_TOOLS }} tag \
111-
${{ env.IMAGE_NAME }}:ci-latest ${{ env.IMAGE_NAME }}:${{ inputs.version }}
112-
113-
- name: Verify image tag exists (if rollback)
114-
if: needs.validate.outputs.tag_exists == 'true'
115-
run: |
116-
echo "Verifying image tag ${{ inputs.version }} exists..."
117-
if ! oc -n ${{ env.OPENSHIFT_NAMESPACE_TOOLS }} get imagestreamtag ${{ env.IMAGE_NAME }}:${{ inputs.version }} &>/dev/null; then
118-
echo "Error: Image tag ${{ inputs.version }} does not exist"
119-
exit 1
108+
if oc -n ${{ env.OPENSHIFT_NAMESPACE_TOOLS }} get imagestreamtag ${{ env.IMAGE_NAME }}:${{ inputs.version }} &>/dev/null; then
109+
echo "Image tag ${{ inputs.version }} already exists - using existing image"
110+
else
111+
echo "Image tag ${{ inputs.version }} does not exist - tagging from ci-latest"
112+
oc -n ${{ env.OPENSHIFT_NAMESPACE_TOOLS }} tag \
113+
${{ env.IMAGE_NAME }}:ci-latest ${{ env.IMAGE_NAME }}:${{ inputs.version }}
120114
fi
121-
echo "Image tag ${{ inputs.version }} found - proceeding with rollback"
122115
123116
- name: Tag version as test
124117
run: |

0 commit comments

Comments
 (0)