forked from binary-com/binary-static
-
Notifications
You must be signed in to change notification settings - Fork 0
62 lines (56 loc) · 3.36 KB
/
generate_app_id.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
name: Binary App ID Generator
on:
issue_comment:
types: [edited]
jobs:
generate_app_id:
timeout-minutes: 5
runs-on: ubuntu-latest
steps:
- name: Capture Vercel preview URL
id: vercel_preview_url
uses: binary-com/[email protected]
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Generate Binary App ID for deployment Preview URL
id: generate_app_id
uses: DerivFE/binary-app-id-action@master
with:
BINARY_API_TOKEN: ${{ secrets.BINARY_API_TOKEN }}
BINARY_APP_ID: ${{ secrets.BINARY_APP_ID }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
max_retries: 5
vercel_preview_url: ${{ steps.vercel_preview_url.outputs.vercel_preview_url }}
- name: Comment on pull request with App ID and URLs
id: sticky_comment_on_pr
if: steps.generate_app_id.outputs.should_post_comment
uses: marocchino/sticky-pull-request-comment@v1
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
header: binary-app-id-action
number: ${{github.event.issue.number}}
message: |
A production App ID was automatically generated for this PR. ([log](https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}))
- **PR test**: [${{ steps.generate_app_id.outputs.pr_url }}](${{ steps.generate_app_id.outputs.pr_url }})
- **URLs**:
- **w/ App ID + Server**: ${{ steps.vercel_preview_url.outputs.vercel_preview_url }}/en/logged_inws.html?qa_server=frontend.binaryws.com&app_id=${{ steps.generate_app_id.outputs.app_id }}
- **Original**: ${{ steps.vercel_preview_url.outputs.vercel_preview_url }}/en/logged_inws.html
- **App ID**: `${{ steps.generate_app_id.outputs.app_id }}`
<details>
<summary>Click here to copy & paste above information.</summary>
```
- **PR**: [${{ steps.generate_app_id.outputs.pr_url }}](${{ steps.generate_app_id.outputs.pr_url }})
- **URLs**:
- **w/ App ID + Server**: ${{ steps.vercel_preview_url.outputs.vercel_preview_url }}/en/logged_inws.html?qa_server=frontend.binaryws.com&app_id=${{ steps.generate_app_id.outputs.app_id }}
- **Original**: ${{ steps.vercel_preview_url.outputs.vercel_preview_url }}/en/logged_inws.html
- **App ID**: `${{ steps.generate_app_id.outputs.app_id }}`
```
</details>
- name: Store generated URL in artifact
run: echo "HOME_URL=${{ steps.vercel_preview_url.outputs.vercel_preview_url }}/en/logged_inws.html?qa_server=frontend.binaryws.com&app_id=${{ steps.generate_app_id.outputs.app_id }}" >> ${{ github.workspace }}/url.txt
- name: Upload artifact
uses: actions/upload-artifact@master
with:
name: generated_url
path: ${{ github.workspace }}/url.txt
retention-days: 1