refactor: chromatic report yml add (#172) #18
Workflow file for this run
This file contains hidden or 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 Deployment" | |
| # on: | |
| # pull_request: | |
| # branches: | |
| # - develop | |
| # jobs: | |
| # chromatic-deployment: | |
| # name: Chromatic | |
| # runs-on: ubuntu-latest | |
| # outputs: | |
| # statis: ${{ job.status }} | |
| # steps: | |
| # - name: Checkout | |
| # uses: actions/checkout@v4 | |
| # with: | |
| # fetch-depth: 0 | |
| # - name: Install dependencies | |
| # run: yarn | |
| # - name: Publish to Chromatic | |
| # id: chromatic | |
| # uses: chromaui/action@latest | |
| # with: | |
| # exitZeroOnChanges: true | |
| # autoAcceptChanges: true | |
| # projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }} | |
| # token: ${{ secrets.TOKEN }} | |
| # - name: comment PR | |
| # uses: thollander/actions-comment-pull-request@v1 | |
| # env: | |
| # GITHUB_TOKEN: ${{ secrets.TOKEN }} | |
| # with: | |
| # message: "storybook: ${{ steps.chromatic.outputs.storybookUrl }}" | |
| name: Chromatic | |
| on: push | |
| 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 | |
| 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: Publish to Chromatic | |
| uses: chromaui/action@v11 | |
| id: chromatic | |
| with: | |
| exitZeroOnChanges: true | |
| autoAcceptChanges: true | |
| onlyChanged: true | |
| skip: dependabot/** | |
| projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }} | |
| - 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/ |