1
1
name : Deploy Preview
2
2
on :
3
- workflow_run :
4
- branches :
5
- - main
6
- workflows : [CI]
7
- types :
8
- - completed
3
+ pull_request :
9
4
10
5
concurrency :
11
6
group : ${{ github.workflow }}-${{ github.ref }}
12
7
cancel-in-progress : true
13
8
14
9
jobs :
15
10
build :
16
- if : ${{ always() && github.event.workflow_run .event.pull_request.head.repo.full_name == 'primer/react' }}
11
+ if : ${{ github.event.pull_request.head.repo.full_name == 'primer/react' }}
17
12
runs-on : ubuntu-latest
18
-
19
13
steps :
20
14
- name : Checkout repository
21
15
uses : actions/checkout@v4
@@ -28,33 +22,13 @@ jobs:
28
22
run : npm ci
29
23
- name : Build docs preview
30
24
run : npm run build:docs:preview
31
- - name : Download VRT reports (All flags enabled)
32
- uses : actions/download-artifact@v4
33
- with :
34
- name : vrt-all-flags
35
- path : docs/public/vrt-all-flags
36
- - name : Download VRT reports (No flags enabled)
37
- uses : actions/download-artifact@v4
38
- with :
39
- name : vrt-no-flag
40
- path : docs/public/vrt-no-flag
41
- - name : Download AAT reports (All flags enabled)
42
- uses : actions/download-artifact@v4
43
- with :
44
- name : axe-all-flags
45
- path : docs/public/aat-all-flags
46
- - name : Download AAT reports (No flags enabled)
47
- uses : actions/download-artifact@v4
48
- with :
49
- name : axe
50
- path : docs/public/aat-no-flag
51
25
- uses : actions/upload-pages-artifact@v3
52
26
with :
53
27
name : github-pages
54
28
path : docs/public
55
29
56
30
deploy-preview :
57
- if : ${{ always() && github.event.workflow_run .event.pull_request.head.repo.full_name == 'primer/react' }}
31
+ if : ${{ github.event.pull_request.head.repo.full_name == 'primer/react' }}
58
32
needs : build
59
33
permissions :
60
34
pages : write
74
48
75
49
deploy-storybook :
76
50
name : Preview Storybook
77
- if : ${{ always() && github.event.workflow_run .event.pull_request.head.repo.full_name == 'primer/react' }}
51
+ if : ${{ github.event.pull_request.head.repo.full_name == 'primer/react' }}
78
52
needs : deploy-preview
79
53
permissions :
80
54
deployments : write
@@ -85,14 +59,14 @@ jobs:
85
59
id : storybook
86
60
with :
87
61
token : ${{ secrets.GITHUB_TOKEN }}
88
- environment : storybook-preview-${{ github.event.workflow_run.event. number }}
89
- environment-url : ' ${{ needs.deploy-preview.outputs.deployment_url }}storybook'
62
+ environment : storybook-preview-${{ github.event.number }}
63
+ environment_url : ' ${{ needs.deploy-preview.outputs.deployment_url }}/ storybook'
90
64
- name : Update storybook deployment status (success)
91
65
if : success()
92
66
93
67
with :
94
68
token : ${{ secrets.GITHUB_TOKEN }}
95
- environment-url : ' ${{ needs.deploy-preview.outputs.deployment_url }}storybook'
69
+ environment-url : ' ${{ needs.deploy-preview.outputs.deployment_url }}/ storybook'
96
70
state : ' success'
97
71
deployment-id : ${{ steps.storybook.outputs.deployment_id }}
98
72
- name : Update storybook deployment status (failure)
@@ -102,127 +76,3 @@ jobs:
102
76
token : ${{ secrets.GITHUB_TOKEN }}
103
77
state : ' failure'
104
78
deployment-id : ${{ steps.storybook.outputs.deployment_id }}
105
-
106
- deploy-vrt-no-flag :
107
- name : VRT (No flags enabled)
108
- if : ${{ always() && github.event.workflow_run.event.pull_request.head.repo.full_name == 'primer/react' }}
109
- needs : [deploy-preview]
110
- permissions :
111
- deployments : write
112
- runs-on : ubuntu-latest
113
- steps :
114
-
115
- name : Create GitHub deployment for vrt-no-flag
116
- id : vrt-no-flag
117
- with :
118
- token : ${{ secrets.GITHUB_TOKEN }}
119
- environment : vrt-no-flag-${{ github.event.workflow_run.event.number }}
120
- environment-url : ' ${{ needs.deploy-preview.outputs.deployment_url }}vrt-no-flag'
121
- - name : Update vrt-no-flag deployment status (success)
122
- if : success()
123
-
124
- with :
125
- token : ${{ secrets.GITHUB_TOKEN }}
126
- environment-url : ' ${{ needs.deploy-preview.outputs.deployment_url }}vrt-no-flag'
127
- state : ' success'
128
- deployment-id : ${{ steps.vrt-no-flag.outputs.deployment_id }}
129
- - name : Update vrt-no-flag deployment status (failure)
130
- if : failure()
131
-
132
- with :
133
- token : ${{ secrets.GITHUB_TOKEN }}
134
- state : ' failure'
135
- deployment-id : ${{ steps.vrt-no-flag.outputs.deployment_id }}
136
-
137
- deploy-vrt-all-flags :
138
- name : VRT (All flags enabled)
139
- if : ${{ always() && github.event.workflow_run.event.pull_request.head.repo.full_name == 'primer/react' }}
140
- needs : deploy-preview
141
- permissions :
142
- deployments : write
143
- runs-on : ubuntu-latest
144
- steps :
145
-
146
- name : Create GitHub deployment for vrt-all-flags
147
- id : vrt-all-flags
148
- with :
149
- token : ${{ secrets.GITHUB_TOKEN }}
150
- environment : vrt-all-flags-${{ github.event.workflow_run.event.number }}
151
- environment-url : ' ${{ needs.deploy-preview.outputs.deployment_url }}vrt-all-flags'
152
- - name : Update vrt-all-flags deployment status (success)
153
- if : success()
154
-
155
- with :
156
- token : ${{ secrets.GITHUB_TOKEN }}
157
- environment-url : ' ${{ needs.deploy-preview.outputs.deployment_url }}vrt-all-flags'
158
- state : ' success'
159
- deployment-id : ${{ steps.vrt-all-flags.outputs.deployment_id }}
160
- - name : Update vrt-all-flags deployment status (failure)
161
- if : failure()
162
-
163
- with :
164
- token : ${{ secrets.GITHUB_TOKEN }}
165
- state : ' failure'
166
- deployment-id : ${{ steps.vrt-all-flags.outputs.deployment_id }}
167
-
168
- deploy-aat-no-flag :
169
- name : AAT (No flags enabled)
170
- if : ${{ always() && github.event.workflow_run.event.pull_request.head.repo.full_name == 'primer/react' }}
171
- needs : deploy-preview
172
- permissions :
173
- deployments : write
174
- runs-on : ubuntu-latest
175
- steps :
176
-
177
- name : Create GitHub deployment for aat-no-flag
178
- id : aat-no-flag
179
- with :
180
- token : ${{ secrets.GITHUB_TOKEN }}
181
- environment : aat-no-flag-${{ github.event.workflow_run.event.number }}
182
- environment-url : ' ${{ needs.deploy-preview.outputs.deployment_url }}aat-no-flag'
183
- - name : Update aat-no-flag deployment status (success)
184
- if : success()
185
-
186
- with :
187
- token : ${{ secrets.GITHUB_TOKEN }}
188
- environment-url : ' ${{ needs.deploy-preview.outputs.deployment_url }}aat-no-flag'
189
- state : ' success'
190
- deployment-id : ${{ steps.aat-no-flag.outputs.deployment_id }}
191
- - name : Update aat-no-flag deployment status (failure)
192
- if : failure()
193
-
194
- with :
195
- token : ${{ secrets.GITHUB_TOKEN }}
196
- state : ' failure'
197
- deployment-id : ${{ steps.aat-no-flag.outputs.deployment_id }}
198
-
199
- deploy-aat-all-flags :
200
- name : AAT (All flags enabled)
201
- if : ${{ always() && github.event.workflow_run.event.pull_request.head.repo.full_name == 'primer/react' }}
202
- needs : deploy-preview
203
- permissions :
204
- deployments : write
205
- runs-on : ubuntu-latest
206
- steps :
207
-
208
- name : Create GitHub deployment for aat-all-flags
209
- id : aat-all-flags
210
- with :
211
- token : ${{ secrets.GITHUB_TOKEN }}
212
- environment : aat-all-flags-${{ github.event.workflow_run.event.number }}
213
- environment-url : ' ${{ needs.deploy-preview.outputs.deployment_url }}aat-all-flags'
214
- - name : Update aat-all-flags deployment status (success)
215
- if : success()
216
-
217
- with :
218
- token : ${{ secrets.GITHUB_TOKEN }}
219
- environment-url : ' ${{ needs.deploy-preview.outputs.deployment_url }}aat-all-flags'
220
- state : ' success'
221
- deployment-id : ${{ steps.aat-all-flags.outputs.deployment_id }}
222
- - name : Update aat-all-flags deployment status (failure)
223
- if : failure()
224
-
225
- with :
226
- token : ${{ secrets.GITHUB_TOKEN }}
227
- state : ' failure'
228
- deployment-id : ${{ steps.aat-all-flags.outputs.deployment_id }}
0 commit comments