chromatic.yml 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. # .github/workflows/chromatic.yml
  2. # Workflow name
  3. name: 'test:chromatic'
  4. # Event for the workflow
  5. on:
  6. pull_request:
  7. branches: [main, test-chromatic]
  8. paths:
  9. - 'packages/**/*.scss'
  10. - '!packages/**/_story/**'
  11. - '!packages/**/__test__/**'
  12. - '!packages/**/*.stories.[tj]sx?'
  13. - '!packages/**/*.story.[tj]sx?'
  14. - '!packages/**/*.test.[tj]sx?'
  15. - '!packages/**/*.md'
  16. push:
  17. branches: [main, test-chromatic]
  18. paths:
  19. - 'packages/**/*.scss'
  20. - '!packages/**/*.md'
  21. # List of jobs
  22. jobs:
  23. chromatic-deployment:
  24. # Operating System
  25. runs-on: ubuntu-latest
  26. if: github.event_name == 'push' && github.repository_owner == 'DouyinFE' || github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == 'DouyinFE/semi-design'
  27. # Job steps
  28. steps:
  29. - uses: actions/checkout@v1
  30. - uses: actions/setup-node@v3
  31. with:
  32. node-version: '16'
  33. - name: Install dependencies
  34. run: npx lerna@^6 bootstrap
  35. - name: Pre-build libs
  36. run: npx lerna@^6 run build:lib
  37. - name: Publish to Chromatic
  38. uses: chromaui/action@v1
  39. # Chromatic GitHub Action options
  40. with:
  41. token: ${{ secrets.GITHUB_TOKEN }}
  42. # 👇 Chromatic projectToken, refer to the manage page to obtain it.
  43. projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
  44. buildScriptName: 'build-storybook-static'