ci(changesets): version packages #2817
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Chromatic | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
paths: | |
- packages/bezier-react/** | |
jobs: | |
chromatic-deployment: | |
if: github.actor != 'dependabot[bot]' && github.actor != 'renovate[bot]' && github.actor != 'ch-builder' | |
name: Chromatic | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
# By default checkout action checkouts to merge commit on pull_request event | |
# checkout to the HEAD commit of PR here, because chromatic checkouts to HEAD commit of PR | |
# https://www.chromatic.com/docs/turbosnap#github-pullrequest-triggers | |
ref: ${{ github.event.pull_request.head.sha }} | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version-file: .nvmrc | |
cache: yarn | |
- name: Restore cache | |
uses: actions/cache@v4 | |
with: | |
path: | | |
**/.turbo | |
node_modules/.cache/turbo | |
key: ${{ runner.os }}-chromatic-${{ github.sha }} | |
restore-keys: | | |
${{ runner.os }}-chromatic- | |
- name: Install dependencies | |
run: yarn | |
- name: Build bezier-react's dependencies | |
run: yarn build [email protected]/bezier-react^... | |
- name: Publish to Chromatic | |
uses: chromaui/action@v11 | |
id: chromatic | |
with: | |
workingDir: packages/bezier-react | |
exitZeroOnChanges: true | |
autoAcceptChanges: true | |
onlyChanged: true | |
skip: dependabot/** | |
projectToken: 06157a6fbe6f | |
- name: Save PR number and Chromatic build outputs | |
run: | | |
mkdir -p ./pr | |
echo "${{ github.event.pull_request.number }}" > ./pr/prNumber | |
echo "${{ steps.chromatic.outputs.storybookUrl }}" > ./pr/storybookUrl | |
echo "${{ steps.chromatic.outputs.buildUrl }}" > ./pr/buildUrl | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: pr | |
path: pr/ |