7070 name : sharedconfig
7171 path : sharedconfig.zip
7272
73- deploystaging :
74- if : " !github.event.release.prerelease"
75- runs-on : stagingserver
73+ parse-deploy-body :
74+ runs-on : ubuntu-latest
75+ outputs :
76+ deploy_linux : ${{ steps.set.outputs.deploy_linux }}
77+ deploy_windows : ${{ steps.set.outputs.deploy_windows }}
78+ steps :
79+ - name : Parse deployment targets from release body
80+ id : set
81+ run : |
82+ body="${{ github.event.release.body }}"
83+ targets=$(echo "$body" | grep -i '^deploy:' | cut -d':' -f2 | tr -d ' ' | tr '[:upper:]' '[:lower:]')
84+
85+ if [[ "$targets" == *"linux"* ]]; then
86+ echo "deploy_linux=true" >> $GITHUB_OUTPUT
87+ else
88+ echo "deploy_linux=false" >> $GITHUB_OUTPUT
89+ fi
90+
91+ if [[ "$targets" == *"windows"* ]]; then
92+ echo "deploy_windows=true" >> $GITHUB_OUTPUT
93+ else
94+ echo "deploy_windows=false" >> $GITHUB_OUTPUT
95+ fi
96+
97+ deploystaging_windows :
98+ needs : parse-deploy-body
99+ if : needs.parse-deploy-body.outputs.deploy_linux == 'true'
100+ runs-on : [stagingserver, windows]
76101 needs : buildconfigpackage
77102 environment : staging
78103 name : " Deploy to Staging"
@@ -87,10 +112,29 @@ jobs:
87112 run : |
88113 Expand-Archive -Path sharedconfig.zip -DestinationPath "C:\home\txnproc\config" -Force
89114
90- deployproduction :
91- if : " !github.event.release.prerelease"
92- runs-on : productionserver
93- needs : [buildconfigpackage, deploystaging]
115+ deploystaging_linux :
116+ needs : parse-deploy-body
117+ if : needs.parse-deploy-body.outputs.deploy_linux == 'true'
118+ runs-on : [stagingserver, linux]
119+ needs : buildconfigpackage
120+ environment : staging
121+ name : " Deploy to Staging"
122+
123+ steps :
124+ - name : Download the artifact
125+ uses : actions/download-artifact@v4.1.7
126+ with :
127+ name : sharedconfig
128+
129+ - name : deploy config
130+ run : |
131+ unzip sharedconfig.zip -d /home/txnproc/config
132+
133+ deployproduction_windows :
134+ needs : parse-deploy-body
135+ if : needs.parse-deploy-body.outputs.deploy_linux == 'true'
136+ runs-on : [productionserver, windows]
137+ needs : [buildconfigpackage, deploystaging_windows]
94138 environment : production
95139 name : " Deploy to Production"
96140
@@ -103,3 +147,21 @@ jobs:
103147 - name : deploy config
104148 run : |
105149 Expand-Archive -Path sharedconfig.zip -DestinationPath "C:\home\txnproc\config" -Force
150+
151+ deployproduction_linux :
152+ needs : parse-deploy-body
153+ if : needs.parse-deploy-body.outputs.deploy_linux == 'true'
154+ runs-on : [productionserver, linux]
155+ needs : [buildconfigpackage, deploystaging_linux]
156+ environment : production
157+ name : " Deploy to Production"
158+
159+ steps :
160+ - name : Download the artifact
161+ uses : actions/download-artifact@v4.1.7
162+ with :
163+ name : sharedconfig
164+
165+ - name : deploy config
166+ run : |
167+ unzip sharedconfig.zip -d /home/txnproc/config
0 commit comments