ci(#10336): use Chromatic for checks
This commit is contained in:
parent
423a67fb06
commit
b1b871aebf
1 changed files with 6 additions and 14 deletions
20
.github/workflows/storybook.yml
vendored
20
.github/workflows/storybook.yml
vendored
|
@ -5,7 +5,7 @@ on:
|
||||||
branches:
|
branches:
|
||||||
- master
|
- master
|
||||||
- develop
|
- develop
|
||||||
pull_request:
|
pull_request_target:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
|
@ -40,22 +40,14 @@ jobs:
|
||||||
id: chromatic
|
id: chromatic
|
||||||
uses: chromaui/action@v1
|
uses: chromaui/action@v1
|
||||||
with:
|
with:
|
||||||
exitZeroOnChanges: false
|
|
||||||
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
|
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
|
||||||
storybookBuildDir: storybook-static
|
storybookBuildDir: storybook-static
|
||||||
workingDir: packages/frontend
|
workingDir: packages/frontend
|
||||||
- name: Notify on changes
|
- name: Compare on Chromatic
|
||||||
uses: actions/github-script@v6.4.0
|
if: github.event_name == 'pull_request_target'
|
||||||
if: failure()
|
run: pnpm --filter frontend chromatic --exit-once-uploaded --patch-build ${{ github.head_ref }}...${{ github.base_ref }}
|
||||||
with:
|
env:
|
||||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
CHROMATIC_PROJECT_TOKEN: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
|
||||||
script: |
|
|
||||||
github.rest.issues.createComment({
|
|
||||||
issue_number: context.issue.number,
|
|
||||||
owner: context.repo.owner,
|
|
||||||
repo: context.repo.repo,
|
|
||||||
body: 'Chromatic has detected ${{ steps.chromatic.outputs.changeCount }} changes in the Storybook. [Check it out](${{ steps.chromatic.outputs.url }}).'
|
|
||||||
})
|
|
||||||
- name: Upload Artifacts
|
- name: Upload Artifacts
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
|
|
Loading…
Reference in a new issue