Skip to content

Commit 15270ac

Browse files
authored
revert: restore deploy preview behavior (#5536)
* Revert "Fix Prod Storybook deployment (#5535)" This reverts commit 8b96591. * Revert "fix: deploy_preview workflow (#5529)" This reverts commit be42cc6. * Revert "Fixing deploy_preview workflow (#5526)" This reverts commit 62353f2. * Revert "Remove branch from preview_deploy.yml (#5523)" This reverts commit e2075bd. * Revert "Add landing page and upload vrt/aat reports to GitHub Pages (#5499)" This reverts commit 5a6d7bb.
1 parent 8b96591 commit 15270ac

File tree

8 files changed

+33
-311
lines changed

8 files changed

+33
-311
lines changed

.github/workflows/ci.yml

-4
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,6 @@ jobs:
170170
path: playwright-report
171171
- name: check vrt-runner job status
172172
if: ${{ needs.vrt-runner.result == 'failure' }}
173-
continue-on-error: true
174173
run: exit 1
175174

176175
vrt-runner-all-flags:
@@ -247,7 +246,6 @@ jobs:
247246
path: playwright-report
248247
- name: check vrt-runner-all-flags job status
249248
if: ${{ needs.vrt-runner-all-flags.result == 'failure' }}
250-
continue-on-error: true
251249
run: exit 1
252250

253251
aat-runner:
@@ -320,7 +318,6 @@ jobs:
320318
path: playwright-report
321319
- name: Check aat-runner job status
322320
if: ${{ needs.aat-runner.result == 'failure' }}
323-
continue-on-error: true
324321
run: exit 1
325322

326323
aat-runner-all-flags:
@@ -397,7 +394,6 @@ jobs:
397394
path: playwright-report
398395
- name: Check aat-runner-all-flags job status
399396
if: ${{ needs.aat-runner-all-flags.result == 'failure' }}
400-
continue-on-error: true
401397
run: exit 1
402398

403399
build-components-json:

.github/workflows/deploy_preview.yml

+31-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ jobs:
1010
build:
1111
if: ${{ github.event.pull_request.head.repo.full_name == 'primer/react' }}
1212
runs-on: ubuntu-latest
13-
1413
steps:
1514
- name: Checkout repository
1615
uses: actions/checkout@v4
@@ -46,3 +45,34 @@ jobs:
4645
uses: actions/deploy-pages@v4
4746
with:
4847
preview: true
48+
49+
deploy-storybook:
50+
name: Preview Storybook
51+
if: ${{ github.event.pull_request.head.repo.full_name == 'primer/react' }}
52+
needs: deploy-preview
53+
permissions:
54+
deployments: write
55+
runs-on: ubuntu-latest
56+
steps:
57+
- uses: chrnorm/[email protected]
58+
name: Create GitHub deployment for storybook
59+
id: storybook
60+
with:
61+
token: ${{ secrets.GITHUB_TOKEN }}
62+
environment: storybook-preview-${{ github.event.number }}
63+
environment_url: '${{ needs.deploy-preview.outputs.deployment_url }}/storybook'
64+
- name: Update storybook deployment status (success)
65+
if: success()
66+
uses: chrnorm/[email protected]
67+
with:
68+
token: ${{ secrets.GITHUB_TOKEN }}
69+
environment-url: '${{ needs.deploy-preview.outputs.deployment_url }}/storybook'
70+
state: 'success'
71+
deployment-id: ${{ steps.storybook.outputs.deployment_id }}
72+
- name: Update storybook deployment status (failure)
73+
if: failure()
74+
uses: chrnorm/[email protected]
75+
with:
76+
token: ${{ secrets.GITHUB_TOKEN }}
77+
state: 'failure'
78+
deployment-id: ${{ steps.storybook.outputs.deployment_id }}

.github/workflows/deploy_preview_with_reports.yml

-238
This file was deleted.

package.json

-3
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,8 @@
1616
"start": "concurrently npm:start:*",
1717
"start:storybook": "npm run start:storybook -w @primer/react",
1818
"build:storybook": "script/build-storybook",
19-
"build:storybook:preview": "script/build-storybook preview",
20-
"build:storybook:preview_with_reports": "script/build-storybook preview_with_reports",
2119
"build:docs": "NODE_OPTIONS=--openssl-legacy-provider script/build-docs",
2220
"build:docs:preview": "NODE_OPTIONS=--openssl-legacy-provider script/build-docs preview",
23-
"build:docs:preview_with_reports": "NODE_OPTIONS=--openssl-legacy-provider script/build-docs preview_with_reports",
2421
"build:components.json": "npm run build:components.json -w @primer/react",
2522
"lint": "eslint '**/*.{js,ts,tsx,md,mdx}' --max-warnings=0",
2623
"lint:css": "stylelint --rd -q '**/*.css'",

packages/react/.storybook/index.html

-22
This file was deleted.

packages/react/.storybook/index_with_reports.html

-28
This file was deleted.

script/build-docs

+2-5
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
11
#!/bin/bash
22
set -e
33

4-
if [ "$1" == "preview" ]; then
4+
if [ -n "$1" ]; then
55
export DEPLOY_ENV="preview"
6-
npm run build:storybook:preview
7-
elif [ "$1" == "preview_with_reports" ]; then
8-
export DEPLOY_ENV="preview"
9-
npm run build:storybook:preview_with_reports
6+
npm run build:storybook preview
107
else
118
export DEPLOY_ENV="production"
129
npm run build:storybook

0 commit comments

Comments
 (0)