Skip to content

docs: add component spec skill #32508

docs: add component spec skill

docs: add component spec skill #32508

name: Deploy Preview
on:
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
vrt-reports:
if: ${{ github.event.pull_request.head.repo.full_name == 'primer/react' }}
uses: ./.github/workflows/vrt-reports.yml
aat-reports:
if: ${{ github.event.pull_request.head.repo.full_name == 'primer/react' }}
uses: ./.github/workflows/aat-reports.yml
build:
if: ${{ always() && github.event.pull_request.head.repo.full_name == 'primer/react' }}
needs: [vrt-reports, aat-reports]
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0
- name: Set up Node.js
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e
with:
node-version-file: '.nvmrc'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Build docs preview
run: npm run build:docs:preview
- name: Download VRT reports
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c
with:
name: vrt
path: docs/public/vrt
- name: Download AAT reports
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c
with:
name: aat
path: docs/public/aat
- uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9
with:
name: github-pages
path: docs/public
deploy-preview:
if: ${{ always() && github.event.pull_request.head.repo.full_name == 'primer/react' }}
needs: build
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
outputs:
deployment_url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@cd2ce8fcbc39b97be8ca5fce6e763baed58fa128
with:
preview: true
deploy-storybook:
name: Preview Storybook
if: ${{ always() && github.event.pull_request.head.repo.full_name == 'primer/react' }}
needs: deploy-preview
permissions:
deployments: write
runs-on: ubuntu-latest
steps:
- uses: chrnorm/deployment-action@500aa6a23c81ffa1acf71072aee3cfa2cc2e556a
name: Create GitHub deployment for storybook
id: storybook
with:
token: ${{ secrets.GITHUB_TOKEN }}
environment: storybook-preview-${{ github.event.number }}
environment-url: '${{ needs.deploy-preview.outputs.deployment_url }}storybook'
- name: Update storybook deployment status (success)
if: success()
uses: chrnorm/deployment-status@6df8d036fd2fee9eb82936733953da1f8382b41e
with:
token: ${{ secrets.GITHUB_TOKEN }}
environment-url: '${{ needs.deploy-preview.outputs.deployment_url }}storybook'
state: 'success'
deployment-id: ${{ steps.storybook.outputs.deployment_id }}
- name: Update storybook deployment status (failure)
if: failure()
uses: chrnorm/deployment-status@6df8d036fd2fee9eb82936733953da1f8382b41e
with:
token: ${{ secrets.GITHUB_TOKEN }}
state: 'failure'
deployment-id: ${{ steps.storybook.outputs.deployment_id }}