-
Notifications
You must be signed in to change notification settings - Fork 566
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add landing page and upload vrt/aat reports to GitHub Pages #5499
Changes from all commits
c80ac17
a6878ff
4680b7f
d6d1dcc
cb9c650
d021ff3
88458d1
14da295
d23b6f3
1eeaea7
f94543a
162d8d4
e6717aa
c83778c
a37676a
dc43e5d
bfff220
a5b01b4
a7e41ff
a708934
3d08d7d
1b07d6e
a1d4219
d1ecd46
e3ea470
d799e78
0193494
2aac527
20b2de0
3f5ea17
d29843f
2fa3e98
68a4fbe
75fb124
6360b93
c481053
1ad7e8e
afbdd0c
e9da6cd
d9c0e72
992d712
b454071
7a139aa
0002515
0afa219
e9f161d
4a00c26
5057377
f0c5679
e624f26
934ec19
880a3d2
4997082
59d0e30
97ae03e
58fc37a
69cd17d
cc826c1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,21 @@ | ||
name: Deploy Preview | ||
on: | ||
pull_request: | ||
workflow_run: | ||
branches: | ||
- main | ||
workflows: [CI] | ||
types: | ||
- completed | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
build: | ||
if: ${{ github.event.pull_request.head.repo.full_name == 'primer/react' }} | ||
if: ${{ always() && github.event.workflow_run.event.pull_request.head.repo.full_name == 'primer/react' }} | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
@@ -22,13 +28,33 @@ jobs: | |
run: npm ci | ||
- name: Build docs preview | ||
run: npm run build:docs:preview | ||
- name: Download VRT reports (All flags enabled) | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: vrt-all-flags | ||
path: docs/public/vrt-all-flags | ||
- name: Download VRT reports (No flags enabled) | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: vrt-no-flag | ||
path: docs/public/vrt-no-flag | ||
- name: Download AAT reports (All flags enabled) | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: axe-all-flags | ||
path: docs/public/aat-all-flags | ||
- name: Download AAT reports (No flags enabled) | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: axe | ||
path: docs/public/aat-no-flag | ||
Comment on lines
+31
to
+50
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That was also my assumption and they seem to be updating correctly on each run |
||
- uses: actions/upload-pages-artifact@v3 | ||
with: | ||
name: github-pages | ||
path: docs/public | ||
|
||
deploy-preview: | ||
if: ${{ github.event.pull_request.head.repo.full_name == 'primer/react' }} | ||
if: ${{ always() && github.event.workflow_run.event.pull_request.head.repo.full_name == 'primer/react' }} | ||
needs: build | ||
permissions: | ||
pages: write | ||
|
@@ -48,7 +74,7 @@ jobs: | |
|
||
deploy-storybook: | ||
name: Preview Storybook | ||
if: ${{ github.event.pull_request.head.repo.full_name == 'primer/react' }} | ||
if: ${{ always() && github.event.workflow_run.event.pull_request.head.repo.full_name == 'primer/react' }} | ||
needs: deploy-preview | ||
permissions: | ||
deployments: write | ||
|
@@ -59,14 +85,14 @@ jobs: | |
id: storybook | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
environment: storybook-preview-${{ github.event.number }} | ||
environment_url: '${{ needs.deploy-preview.outputs.deployment_url }}/storybook' | ||
environment: storybook-preview-${{ github.event.workflow_run.event.number }} | ||
environment-url: '${{ needs.deploy-preview.outputs.deployment_url }}storybook' | ||
- name: Update storybook deployment status (success) | ||
if: success() | ||
uses: chrnorm/[email protected] | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
environment-url: '${{ needs.deploy-preview.outputs.deployment_url }}/storybook' | ||
environment-url: '${{ needs.deploy-preview.outputs.deployment_url }}storybook' | ||
state: 'success' | ||
deployment-id: ${{ steps.storybook.outputs.deployment_id }} | ||
- name: Update storybook deployment status (failure) | ||
|
@@ -76,3 +102,127 @@ jobs: | |
token: ${{ secrets.GITHUB_TOKEN }} | ||
state: 'failure' | ||
deployment-id: ${{ steps.storybook.outputs.deployment_id }} | ||
|
||
deploy-vrt-no-flag: | ||
name: VRT (No flags enabled) | ||
if: ${{ always() && github.event.workflow_run.event.pull_request.head.repo.full_name == 'primer/react' }} | ||
needs: [deploy-preview] | ||
permissions: | ||
deployments: write | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: chrnorm/[email protected] | ||
name: Create GitHub deployment for vrt-no-flag | ||
id: vrt-no-flag | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
environment: vrt-no-flag-${{ github.event.workflow_run.event.number }} | ||
environment-url: '${{ needs.deploy-preview.outputs.deployment_url }}vrt-no-flag' | ||
- name: Update vrt-no-flag deployment status (success) | ||
if: success() | ||
uses: chrnorm/[email protected] | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
environment-url: '${{ needs.deploy-preview.outputs.deployment_url }}vrt-no-flag' | ||
state: 'success' | ||
deployment-id: ${{ steps.vrt-no-flag.outputs.deployment_id }} | ||
- name: Update vrt-no-flag deployment status (failure) | ||
if: failure() | ||
uses: chrnorm/[email protected] | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
state: 'failure' | ||
deployment-id: ${{ steps.vrt-no-flag.outputs.deployment_id }} | ||
|
||
deploy-vrt-all-flags: | ||
name: VRT (All flags enabled) | ||
if: ${{ always() && github.event.workflow_run.event.pull_request.head.repo.full_name == 'primer/react' }} | ||
needs: deploy-preview | ||
permissions: | ||
deployments: write | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: chrnorm/[email protected] | ||
name: Create GitHub deployment for vrt-all-flags | ||
id: vrt-all-flags | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
environment: vrt-all-flags-${{ github.event.workflow_run.event.number }} | ||
environment-url: '${{ needs.deploy-preview.outputs.deployment_url }}vrt-all-flags' | ||
- name: Update vrt-all-flags deployment status (success) | ||
if: success() | ||
uses: chrnorm/[email protected] | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
environment-url: '${{ needs.deploy-preview.outputs.deployment_url }}vrt-all-flags' | ||
state: 'success' | ||
deployment-id: ${{ steps.vrt-all-flags.outputs.deployment_id }} | ||
- name: Update vrt-all-flags deployment status (failure) | ||
if: failure() | ||
uses: chrnorm/[email protected] | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
state: 'failure' | ||
deployment-id: ${{ steps.vrt-all-flags.outputs.deployment_id }} | ||
|
||
deploy-aat-no-flag: | ||
name: AAT (No flags enabled) | ||
if: ${{ always() && github.event.workflow_run.event.pull_request.head.repo.full_name == 'primer/react' }} | ||
needs: deploy-preview | ||
permissions: | ||
deployments: write | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: chrnorm/[email protected] | ||
name: Create GitHub deployment for aat-no-flag | ||
id: aat-no-flag | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
environment: aat-no-flag-${{ github.event.workflow_run.event.number }} | ||
environment-url: '${{ needs.deploy-preview.outputs.deployment_url }}aat-no-flag' | ||
- name: Update aat-no-flag deployment status (success) | ||
if: success() | ||
uses: chrnorm/[email protected] | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
environment-url: '${{ needs.deploy-preview.outputs.deployment_url }}aat-no-flag' | ||
state: 'success' | ||
deployment-id: ${{ steps.aat-no-flag.outputs.deployment_id }} | ||
- name: Update aat-no-flag deployment status (failure) | ||
if: failure() | ||
uses: chrnorm/[email protected] | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
state: 'failure' | ||
deployment-id: ${{ steps.aat-no-flag.outputs.deployment_id }} | ||
|
||
deploy-aat-all-flags: | ||
name: AAT (All flags enabled) | ||
if: ${{ always() && github.event.workflow_run.event.pull_request.head.repo.full_name == 'primer/react' }} | ||
needs: deploy-preview | ||
permissions: | ||
deployments: write | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: chrnorm/[email protected] | ||
name: Create GitHub deployment for aat-all-flags | ||
id: aat-all-flags | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
environment: aat-all-flags-${{ github.event.workflow_run.event.number }} | ||
environment-url: '${{ needs.deploy-preview.outputs.deployment_url }}aat-all-flags' | ||
- name: Update aat-all-flags deployment status (success) | ||
if: success() | ||
uses: chrnorm/[email protected] | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
environment-url: '${{ needs.deploy-preview.outputs.deployment_url }}aat-all-flags' | ||
state: 'success' | ||
deployment-id: ${{ steps.aat-all-flags.outputs.deployment_id }} | ||
- name: Update aat-all-flags deployment status (failure) | ||
if: failure() | ||
uses: chrnorm/[email protected] | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
state: 'failure' | ||
deployment-id: ${{ steps.aat-all-flags.outputs.deployment_id }} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>Primer Preview Page</title> | ||
<link href="https://unpkg.com/@primer/css@^20.2.4/dist/primer.css" rel="stylesheet" /> | ||
</head> | ||
<body class="p-3"> | ||
<div class="Header"> | ||
<h1>Primer Preview Page</h1> | ||
</div> | ||
<div class="p-2 m-2 d-flex flex-column"> | ||
<ul class="filter-list"> | ||
<li><a class="filter-item" href="./storybook" class="btn-link mb-2">Storybook</a></li> | ||
<li><a class="filter-item" href="./vrt-no-flag" class="btn-link mb-2">Visual Regression Testing</a></li> | ||
<li><a class="filter-item" href="./vrt-all-flags" class="btn-link mb-2">Visual Regression Testing (All Flags | ||
Enabled)</a></li> | ||
<li><a class="filter-item" href="./aat-no-flag" class="btn-link mb-2">Automated Accessibility Testing</a></li> | ||
<li><a class="filter-item" href="./aat-all-flags" class="btn-link mb-2">Automated Accessibility Testing (All Flags | ||
Enabled)</a></li> | ||
</ul> | ||
</div> | ||
</body> | ||
</html> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just thinking out loud, would it be possible for the required jobs to stay in the ci workflow and then have
deploy_preview
's trigger beworkflow_run
? Then we could use thatdeploy_preview
workflow to download artifacts from theCI
workflow that we would like to host/deploy.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can give that a try. I think I was initially trying to avoid
deploy_preview
from waiting forci
and parallelize the reports running to run but it probably won't have a significant impact of time. Also it would minimize the changes being made at this point.