@@ -99,29 +99,52 @@ jobs:
99
99
# PREVIEW branch
100
100
- name : Deploy ${{ github.ref_name }} to PREVIEW branch of ${{ env.PROJECT_NAME }} project
101
101
if : github.event_name == 'push'
102
+ id : deploy-preview
102
103
uses : cloudflare/wrangler-action@da0e0dfe58b7a431659754fdf3f186c529afbe65 # v3.14.1
103
104
with :
104
105
apiToken : ${{ secrets.CLOUDFLARE_API_TOKEN }}
105
106
accountId : ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
106
- command : pages deploy dist --project-name=${{ env.PROJECT_NAME }} --branch=preview
107
+ command : pages deploy dist --project-name=${{ env.PROJECT_NAME }} --branch=preview --commit-message="LATEST PREVIEW ${{ github.ref_name }}" --commit-hash=${{ github.sha }} --commit-dirty=true
107
108
108
109
# VERSION branch
109
110
- name : Deploy ${{ github.ref_name }} to VERSION branch ${{ github.ref_name }} of ${{ env.PROJECT_NAME }} project
111
+ id : deploy-version
110
112
if : github.event_name == 'push'
111
113
uses : cloudflare/wrangler-action@da0e0dfe58b7a431659754fdf3f186c529afbe65 # v3.14.1
112
114
with :
113
115
apiToken : ${{ secrets.CLOUDFLARE_API_TOKEN }}
114
116
accountId : ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
115
- command : pages deploy dist --project-name=${{ env.PROJECT_NAME }} --branch=${{ github.ref_name }}
117
+ command : pages deploy dist --project-name=${{ env.PROJECT_NAME }} --branch=${{ github.ref_name }} --commit-message="VERSION ${{ github.ref_name }}" --commit-hash=${{ github.sha }} --commit-dirty=true
116
118
117
119
# PRODUCTION branch
118
120
- name : Deploy ${{ github.ref_name }} to PRODUCTION of ${{ env.PROJECT_NAME }} project
121
+ id : deploy-production
119
122
if : github.event_name == 'workflow_dispatch'
120
123
uses : cloudflare/wrangler-action@da0e0dfe58b7a431659754fdf3f186c529afbe65 # v3.14.1
121
124
with :
122
125
apiToken : ${{ secrets.CLOUDFLARE_API_TOKEN }}
123
126
accountId : ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
124
- command : pages deploy dist --project-name=${{ env.PROJECT_NAME }} --branch=master
127
+ command : pages deploy dist --project-name=${{ env.PROJECT_NAME }} --branch=master --commit-message="${{ github.ref_name }}" --commit-hash=${{ github.sha }} --commit-dirty=true
128
+
129
+ # print deployment URLs
130
+
131
+ - name : print PREVIEW deployment-url
132
+ if : steps.deploy-preview.outputs.deployment-url
133
+ env :
134
+ DEPLOYMENT_URL_PREVIEW : ${{ steps.deploy-preview.outputs.deployment-url }}
135
+ run : echo $DEPLOYMENT_URL_PREVIEW
136
+
137
+ - name : print VERSION deployment-url
138
+ if : steps.deploy-version.outputs.deployment-url
139
+ env :
140
+ DEPLOYMENT_URL_VERSION : ${{ steps.deploy-version.outputs.deployment-url }}
141
+ run : echo $DEPLOYMENT_URL_VERSION
142
+
143
+ - name : print PRODUCTION deployment-url
144
+ if : steps.deploy-production.outputs.deployment-url
145
+ env :
146
+ DEPLOYMENT_URL_PRODUCTION : ${{ steps.deploy-production.outputs.deployment-url }}
147
+ run : echo $DEPLOYMENT_URL_PRODUCTION
125
148
126
149
127
150
# #####################################################################
@@ -199,26 +222,49 @@ jobs:
199
222
# PREVIEW branch
200
223
- name : Deploy ${{ github.ref_name }} to PREVIEW branch of ${{ env.PROJECT_NAME }} project
201
224
if : github.event_name == 'push'
225
+ id : deploy-preview
202
226
uses : cloudflare/wrangler-action@da0e0dfe58b7a431659754fdf3f186c529afbe65 # v3.14.1
203
227
with :
204
228
apiToken : ${{ secrets.CLOUDFLARE_API_TOKEN }}
205
229
accountId : ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
206
- command : pages deploy dist --project-name=${{ env.PROJECT_NAME }} --branch=preview
230
+ command : pages deploy dist --project-name=${{ env.PROJECT_NAME }} --branch=preview --commit-message="LATEST PREVIEW ${{ github.ref_name }}" --commit-hash=${{ github.sha }} --commit-dirty=true
207
231
208
232
# VERSION branch
209
233
- name : Deploy ${{ github.ref_name }} to VERSION branch ${{ github.ref_name }} of ${{ env.PROJECT_NAME }} project
234
+ id : deploy-version
210
235
if : github.event_name == 'push'
211
236
uses : cloudflare/wrangler-action@da0e0dfe58b7a431659754fdf3f186c529afbe65 # v3.14.1
212
237
with :
213
238
apiToken : ${{ secrets.CLOUDFLARE_API_TOKEN }}
214
239
accountId : ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
215
- command : pages deploy dist --project-name=${{ env.PROJECT_NAME }} --branch=${{ github.ref_name }}
240
+ command : pages deploy dist --project-name=${{ env.PROJECT_NAME }} --branch=${{ github.ref_name }} --commit-message="VERSION ${{ github.ref_name }}" --commit-hash=${{ github.sha }} --commit-dirty=true
216
241
217
242
# PRODUCTION branch
218
243
- name : Deploy ${{ github.ref_name }} to PRODUCTION of ${{ env.PROJECT_NAME }} project
244
+ id : deploy-production
219
245
if : github.event_name == 'workflow_dispatch'
220
246
uses : cloudflare/wrangler-action@da0e0dfe58b7a431659754fdf3f186c529afbe65 # v3.14.1
221
247
with :
222
248
apiToken : ${{ secrets.CLOUDFLARE_API_TOKEN }}
223
249
accountId : ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
224
- command : pages deploy dist --project-name=${{ env.PROJECT_NAME }} --branch=master
250
+ command : pages deploy dist --project-name=${{ env.PROJECT_NAME }} --branch=master --commit-message="${{ github.ref_name }}" --commit-hash=${{ github.sha }} --commit-dirty=true
251
+
252
+ # print deployment URLs
253
+
254
+ - name : print PREVIEW deployment-url
255
+ if : steps.deploy-preview.outputs.deployment-url
256
+ env :
257
+ DEPLOYMENT_URL_PREVIEW : ${{ steps.deploy-preview.outputs.deployment-url }}
258
+ run : echo $DEPLOYMENT_URL_PREVIEW
259
+
260
+ - name : print VERSION deployment-url
261
+ if : steps.deploy-version.outputs.deployment-url
262
+ env :
263
+ DEPLOYMENT_URL_VERSION : ${{ steps.deploy-version.outputs.deployment-url }}
264
+ run : echo $DEPLOYMENT_URL_VERSION
265
+
266
+ - name : print PRODUCTION deployment-url
267
+ if : steps.deploy-production.outputs.deployment-url
268
+ env :
269
+ DEPLOYMENT_URL_PRODUCTION : ${{ steps.deploy-production.outputs.deployment-url }}
270
+ run : echo $DEPLOYMENT_URL_PRODUCTION
0 commit comments