@@ -151,6 +151,62 @@ commands:
151
151
echo "New website - http://cf-pages-binary-bot.binary.com"
152
152
153
153
jobs :
154
+ generate_app_id :
155
+ timeout-minutes : 5
156
+ runs-on : ubuntu-latest
157
+ steps :
158
+ - name : Capture Vercel preview URL
159
+ id : vercel_preview_url
160
+ uses :
binary-com/[email protected]
161
+ with :
162
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
163
+ preview_url_regexp : \[Visit Preview\]\((.*?.sx)\)
164
+ - name : Generate Deriv App ID for deployment Preview URL
165
+ id : generate_app_id
166
+ uses : binary-com/deriv-app-id-action@v1
167
+ with :
168
+ DERIV_API_TOKEN : ${{ secrets.DERIV_API_TOKEN }}
169
+ DERIV_APP_ID : ${{ secrets.DERIV_APP_ID }}
170
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
171
+ max_retries : 5
172
+ vercel_preview_url : ${{ steps.vercel_preview_url.outputs.vercel_preview_url }}
173
+ - name : Comment on pull request with App ID and URLs
174
+ id : sticky_comment_on_pr
175
+ if : steps.generate_app_id.outputs.should_post_comment
176
+ uses : marocchino/sticky-pull-request-comment@v1
177
+ with :
178
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
179
+ header : deriv-app-id-action
180
+ number : ${{github.event.issue.number}}
181
+ message : |
182
+ A production App ID was automatically generated for this PR. ([log](https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}))
183
+
184
+ - **PR**: [${{ steps.generate_app_id.outputs.pr_url }}](${{ steps.generate_app_id.outputs.pr_url }})
185
+ - **URLs**:
186
+ - **w/ App ID + Server**: ${{ steps.vercel_preview_url.outputs.vercel_preview_url }}?qa_server=frontend.binaryws.com&app_id=${{ steps.generate_app_id.outputs.app_id }}
187
+ - **Original**: ${{ steps.vercel_preview_url.outputs.vercel_preview_url }}
188
+ - **App ID**: `${{ steps.generate_app_id.outputs.app_id }}`
189
+
190
+ <details>
191
+ <summary>Click here to copy & paste above information.</summary>
192
+
193
+ ```
194
+ - **PR**: [${{ steps.generate_app_id.outputs.pr_url }}](${{ steps.generate_app_id.outputs.pr_url }})
195
+ - **URLs**:
196
+ - **w/ App ID + Server**: ${{ steps.vercel_preview_url.outputs.vercel_preview_url }}?qa_server=frontend.binaryws.com&app_id=${{ steps.generate_app_id.outputs.app_id }}
197
+ - **Original**: ${{ steps.vercel_preview_url.outputs.vercel_preview_url }}
198
+ - **App ID**: `${{ steps.generate_app_id.outputs.app_id }}`
199
+ ```
200
+ </details>
201
+
202
+ - name : Store generated URL in artifact
203
+ run : echo "HOME_URL=${{ steps.vercel_preview_url.outputs.vercel_preview_url }}?qa_server=frontend.binaryws.com&app_id=${{ steps.generate_app_id.outputs.app_id }}" >> ${{ github.workspace }}/url.txt
204
+ - name : Upload artifact
205
+ uses : actions/upload-artifact@master
206
+ with :
207
+ name : generated_url
208
+ path : ${{ github.workspace }}/url.txt
209
+ retention-days : 1
154
210
test :
155
211
docker :
156
212
- image : cimg/node:12.18
0 commit comments