Skip to content

2.17.0

2.17.0 #2987

Workflow file for this run

---
name: Chromatic
on:
push:
branches:
- main
pull_request:
branches:
- '**'
jobs:
commit:
name: Publish to Chromatic
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup
uses: ./.github/actions/setup
- name: Wait for Vercel
if: github.run_attempt == '1' && github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name
run: sleep 20
- name: Get Vercel preview
uses: ViktorJT/Get-vercel-preview-url@1.2.2
if: github.ref_name != 'main' && github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name
id: vercel
with:
gh_token: ${{ secrets.GITHUB_TOKEN }}
vercel_access_token: ${{ secrets.VERCEL_ACCESS_TOKEN }}
vercel_team_id: ${{ vars.VERCEL_TEAM_ID }}
prefix_url: 'https://'
prefix_path: /api
- name: Get Seam endpoint
id: seam_endpoint
env:
STORYBOOK_SEAM_ENDPOINT: ${{ vars.STORYBOOK_SEAM_ENDPOINT }}
VERCEL_PREVIEW_URL: ${{ steps.vercel.outputs.preview_url }}
run: |
if [ -n "$VERCEL_PREVIEW_URL" ]; then
echo "url=${VERCEL_PREVIEW_URL}" >> $GITHUB_OUTPUT
else
echo "url=${STORYBOOK_SEAM_ENDPOINT}" >> $GITHUB_OUTPUT
fi
- name: Publish to Chromatic
uses: chromaui/action@v1
with:
projectToken: de095a2cb27a
buildScriptName: storybook:build
env:
STORYBOOK_SEAM_ENDPOINT: ${{ steps.seam_endpoint.outputs.url }}
STORYBOOK_SEAM_PUBLISHABLE_KEY: ${{ vars.STORYBOOK_SEAM_PUBLISHABLE_KEY }}
STORYBOOK_SEAM_USER_IDENTIFIER_KEY: ${{ vars.STORYBOOK_SEAM_USER_IDENTIFIER_KEY }}