在我们的存储库中,我们使用自定义构建脚本来构建故事书 -
"build-storybook": "npm run nx run components:build-storybook && node ./scripts/copyPublicAssets.js",
在 Chromatic 中,我的 github 操作配置如下:
# .github/workflows/chromatic.yml
# Workflow name
name: 'Chromatic'
# Event for the workflow
on: push
# List of jobs
jobs:
chromatic-deployment:
# Operating System
runs-on: ubuntu-latest
# Job steps
steps:
- uses: actions/checkout@v1
- name: Install dependencies
run: npm install
# Adds Chromatic as a step in the workflow
- name: Publish to Chromatic
uses: chromaui/action@v1
# Chromatic GitHub Action options
with:
token: ${{ secrets.GITHUB_TOKEN }}
# Chromatic projectToken, refer to the manage page to obtain it.
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
buildScriptName: "chromatic"
使用此配置,在 github 中创建 PR 时,我看到以下消息:
问题是“发布到彩色”阶段大约需要 10 分钟并且失败。我在操作控制台日志中看不到任何有意义的信息。
任何帮助都将受到欢迎!