1
1
name : Generate preview link
2
2
3
3
on :
4
- pull_request_target :
5
- types : [opened, synchronize]
4
+ pull_request_target :
5
+ types : [opened, synchronize]
6
6
7
7
concurrency :
8
8
group : cloudflare-pages-build-${{ github.head_ref }}
@@ -12,116 +12,116 @@ jobs:
12
12
build_and_deploy_preview_link :
13
13
runs-on : Ubuntu-latest
14
14
permissions :
15
- checks : write
16
- pull-requests : write
15
+ checks : write
16
+ pull-requests : write
17
17
steps :
18
- - name : Verify user
19
- uses : " deriv-com/shared-actions/.github/actions/verify_user_in_organization@v1"
20
- with :
21
- username : ${{github.event.pull_request.user.login}}
22
- token : ${{ secrets.PERSONAL_ACCESS_TOKEN }}
23
-
24
- - name : Post preview build comment
25
- id : post_preview_build_comment
26
- uses : ' deriv-com/shared-actions/.github/actions/post_preview_build_comment@v1'
27
- with :
18
+ - name : Verify user
19
+ uses : ' deriv-com/shared-actions/.github/actions/verify_user_in_organization@v1'
20
+ with :
21
+ username : ${{github.event.pull_request.user.login}}
22
+ token : ${{ secrets.PERSONAL_ACCESS_TOKEN }}
23
+
24
+ - name : Post preview build comment
25
+ id : post_preview_build_comment
26
+ uses : ' deriv-com/shared-actions/.github/actions/post_preview_build_comment@v1'
27
+ with :
28
28
issue_number : ${{github.event.number}}
29
29
head_sha : ${{github.event.pull_request.head.sha}}
30
30
31
- - name : Checkout SmartCharts
32
- uses : ' binary-com/SmartCharts/.github/actions/checkout@master'
33
- with :
31
+ - name : Checkout SmartCharts
32
+ uses : ' binary-com/SmartCharts/.github/actions/checkout@master'
33
+ with :
34
34
repository : ${{github.event.pull_request.user.login}}/SmartCharts
35
35
path : SmartCharts
36
36
ref : ${{github.head_ref}}
37
37
alternate_repository : ' binary-com/SmartCharts'
38
38
alternate_ref : master
39
39
40
- - name : Checkout deriv-app
41
- id : deriv_app
42
- uses : ' binary-com/SmartCharts/.github/actions/checkout@master'
43
- with :
40
+ - name : Checkout deriv-app
41
+ id : deriv_app
42
+ uses : ' binary-com/SmartCharts/.github/actions/checkout@master'
43
+ with :
44
44
repository : ${{github.event.pull_request.user.login}}/deriv-app
45
45
path : deriv-app
46
46
ref : ${{github.head_ref}}
47
47
alternate_repository : ' binary-com/deriv-app'
48
48
alternate_ref : master
49
49
50
- - name : Custom flutter-chart
51
- id : flutter_chart
52
- uses : ' binary-com/SmartCharts/.github/actions/checkout@master'
53
- with :
50
+ - name : Custom flutter-chart
51
+ id : flutter_chart
52
+ uses : ' binary-com/SmartCharts/.github/actions/checkout@master'
53
+ with :
54
54
repository : ${{github.event.pull_request.user.login}}/flutter-chart
55
55
path : flutter-chart
56
56
ref : ${{github.head_ref}}
57
57
alternate_repository : ' regentmarkets/flutter-chart'
58
- alternate_ref : fe-changes
58
+ alternate_ref : dev
59
59
token : ${{ secrets.REPO_READ_TOKEN }}
60
60
61
- - uses : subosito/flutter-action@62f096cacda5168a3bd7b95793373be14fa4fbaf
62
- with :
61
+ - uses : subosito/flutter-action@62f096cacda5168a3bd7b95793373be14fa4fbaf
62
+ with :
63
63
flutter-version : ' 3.10.6'
64
64
channel : ' stable'
65
65
cache : true
66
66
67
- - name : Add SSH key
68
- run : |
69
- mkdir -p ~/.ssh
70
- echo "${{ secrets.SSH_KEY }}" > ~/.ssh/github_action_key
71
- chmod 600 ~/.ssh/github_action_key
67
+ - name : Add SSH key
68
+ run : |
69
+ mkdir -p ~/.ssh
70
+ echo "${{ secrets.SSH_KEY }}" > ~/.ssh/github_action_key
71
+ chmod 600 ~/.ssh/github_action_key
72
72
73
- - name : Build flutter
74
- env :
75
- GIT_SSH_COMMAND : ' ssh -i ~/.ssh/github_action_key'
76
- run : |
73
+ - name : Build flutter
74
+ env :
75
+ GIT_SSH_COMMAND : ' ssh -i ~/.ssh/github_action_key'
76
+ run : |
77
77
cd SmartCharts/chart_app
78
78
flutter pub get
79
79
flutter build web --web-renderer html --release
80
80
81
- - name : Setup Node
82
- uses : actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8
83
- with :
81
+ - name : Setup Node
82
+ uses : actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8
83
+ with :
84
84
node-version : 18.x
85
85
86
- - name : Setup deriv-app
87
- run : cd deriv-app && npm i -g lerna@^5.5.1 && npm run bootstrap
86
+ - name : Setup deriv-app
87
+ run : cd deriv-app && npm i -g lerna@^5.5.1 && npm run bootstrap
88
88
89
- - name : Remove @deriv-charts in deriv-app
90
- run : rm -rf deriv-app/node_modules/@deriv/deriv-charts/dist
89
+ - name : Remove @deriv-charts in deriv-app
90
+ run : rm -rf deriv-app/node_modules/@deriv/deriv-charts/dist
91
91
92
- - name : Setup SmartCharts
93
- run : cd SmartCharts && npm install
92
+ - name : Setup SmartCharts
93
+ run : cd SmartCharts && npm install
94
94
95
- - name : Build SmartCharts
96
- run : cd SmartCharts && npm run build -- --output-path ../deriv-app/node_modules/@deriv/deriv-charts/dist
95
+ - name : Build SmartCharts
96
+ run : cd SmartCharts && npm run build -- --output-path ../deriv-app/node_modules/@deriv/deriv-charts/dist
97
97
98
- - name : Run Tests
99
- run : cd SmartCharts && npm run test
98
+ - name : Run Tests
99
+ run : cd SmartCharts && npm run test
100
100
101
- - name : Build deriv-app
102
- env :
103
- NODE_ENV : ' production'
104
- run : cd deriv-app && npm run build:all
101
+ - name : Build deriv-app
102
+ env :
103
+ NODE_ENV : ' production'
104
+ run : cd deriv-app && npm run build:all
105
105
106
- - name : Setup Node
107
- uses : actions/setup-node@9ced9a43a244f3ac94f13bfd896db8c8f30da67a
108
- with :
109
- node-version : 20
106
+ - name : Setup Node
107
+ uses : actions/setup-node@9ced9a43a244f3ac94f13bfd896db8c8f30da67a
108
+ with :
109
+ node-version : 20
110
110
111
- - name : Publish to CF pages branch
112
- id : publish_to_pages_branch
113
- uses : ' deriv-com/shared-actions/.github/actions/publish_to_pages_branch@v1'
114
- with :
111
+ - name : Publish to CF pages branch
112
+ id : publish_to_pages_branch
113
+ uses : ' deriv-com/shared-actions/.github/actions/publish_to_pages_branch@v1'
114
+ with :
115
115
CLOUDFLARE_API_TOKEN : ${{ secrets.CLOUDFLARE_TEST_LINKS_API_TOKEN }}
116
116
CLOUDFLARE_ACCOUNT_ID : ${{ secrets.CLOUDFLARE_TEST_LINKS_ACCOUNT_ID }}
117
117
project_name : ' smartcharts-preview'
118
118
branch_name : pr-${{github.event.number}}${{ steps.deriv_app.outputs.ref_exists == 'true' && '-dtra' || ''}}${{ steps.flutter_chart.outputs.ref_exists == 'true' && '-flutt' || ''}}
119
119
output_dir : deriv-app/packages/core/dist
120
120
121
- - name : ' Generate preview link comment'
122
- if : always() && steps.post_preview_build_comment.outcome == 'success'
123
- uses : ' deriv-com/shared-actions/.github/actions/post_preview_link_comment@v1'
124
- with :
121
+ - name : ' Generate preview link comment'
122
+ if : always() && steps.post_preview_build_comment.outcome == 'success'
123
+ uses : ' deriv-com/shared-actions/.github/actions/post_preview_link_comment@v1'
124
+ with :
125
125
issue_number : ${{github.event.number}}
126
126
check_run_id : ${{steps.post_preview_build_comment.outputs.check_run_id}}
127
127
preview_url : ${{steps.publish_to_pages_branch.outputs.cf_pages_url}}
0 commit comments