38
38
39
39
on :
40
40
workflow_dispatch :
41
+ inputs :
42
+ tag :
43
+ description : ' The image tag to deploy'
44
+ required : true
45
+ type : string
41
46
42
47
jobs :
43
48
openshift-ci-cd :
50
55
SELECTOR : ${{ steps.deploy-and-expose.outputs.selector }}
51
56
52
57
steps :
58
+ - name : Print Workflow Dispatch Inputs and Env Vars
59
+ uses : shayki5/print-workflow-dispatch-inputs@v1
60
+ with :
61
+ add_to_summary : ' true'
62
+ print_env_vars : ' false'
53
63
- name : Check for required secrets
54
64
uses : actions/github-script@v6
55
65
with :
@@ -93,10 +103,6 @@ jobs:
93
103
with :
94
104
ref : ${{ env.BRANCH }}
95
105
96
- - name : Get latest tag
97
- uses : actions-ecosystem/action-get-latest-tag@v1
98
- id : get-latest-tag
99
-
100
106
- name : Install oc
101
107
uses : redhat-actions/openshift-tools-installer@v1
102
108
with :
@@ -116,15 +122,15 @@ jobs:
116
122
oc create imagestream ${{ env.IMAGE_NAME }} 2> /dev/null || true && echo "backend image stream in place"
117
123
118
124
# Create tag for PROD env from DEV env image
119
- oc tag ${{ env.NAMESPACE }}-dev/${{ env.REPO_NAME }}-${{ env.APP_NAME_BACKEND }}:${{ steps.get-latest- tag.outputs.tag }} ${{ env.NAMESPACE }}-prod/${{ env.REPO_NAME }}-${{ env.APP_NAME_BACKEND }}:${{ steps.get-latest-tag.outputs .tag }}
125
+ oc tag ${{ env.NAMESPACE }}-dev/${{ env.REPO_NAME }}-${{ env.APP_NAME_BACKEND }}:${{ inputs. tag }} ${{ env.NAMESPACE }}-prod/${{ env.REPO_NAME }}-${{ env.APP_NAME_BACKEND }}:${{ inputs .tag }}
120
126
121
127
# Process and apply deployment template
122
128
oc process -f tools/openshift/backend-tls.dc.yaml \
123
129
-p APP_NAME=${{ env.APP_NAME }} \
124
130
-p REPO_NAME=${{ env.REPO_NAME }} \
125
131
-p BRANCH=${{ env.BRANCH }} \
126
132
-p NAMESPACE=${{ env.OPENSHIFT_NAMESPACE }} \
127
- -p TAG=${{ steps.get-latest-tag.outputs .tag }} \
133
+ -p TAG=${{ inputs .tag }} \
128
134
-p MIN_REPLICAS=${{ env.MIN_REPLICAS }} \
129
135
-p MAX_REPLICAS=${{ env.MAX_REPLICAS }} \
130
136
-p MIN_CPU=${{ env.MIN_CPU }} \
0 commit comments