Release v3.0.0 Prep #26
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: CI and Chromatic | |
| on: | |
| push: | |
| branches: [main, master] | |
| pull_request: | |
| branches: [main, master] | |
| jobs: | |
| ci: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - uses: pnpm/action-setup@v4 | |
| name: Install pnpm | |
| with: | |
| run_install: false | |
| - name: Setup Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version-file: ".nvmrc" | |
| cache: "pnpm" | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Type check | |
| run: pnpm run type-check | |
| - name: Check formatting and linting | |
| run: pnpm run check | |
| - name: Run tests | |
| run: pnpm run test:ci | |
| - name: Build project | |
| run: pnpm run build | |
| chromatic: | |
| runs-on: ubuntu-latest | |
| needs: ci | |
| if: github.event_name == 'pull_request' || github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| # Chromatic needs to know the git history to make sure it only runs changed components | |
| fetch-depth: 0 | |
| - uses: pnpm/action-setup@v4 | |
| name: Install pnpm | |
| with: | |
| run_install: false | |
| - name: Setup Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version-file: ".nvmrc" | |
| cache: "pnpm" | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Publish to Chromatic | |
| uses: chromaui/action@v1 | |
| with: | |
| # Chromatic project token. This value should be set in GitHub Secrets | |
| projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }} | |
| # Build the Storybook static files using the existing script | |
| buildScriptName: build-storybook | |
| # The working directory that contains the package.json with the build-storybook script | |
| workingDir: ./ | |
| # Only run this action on changed components | |
| onlyChanged: true | |
| # Automatically accept all changes on the main branch | |
| autoAcceptChanges: ${{ github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' }} | |
| # Exit with 0 on visual changes | |
| exitZeroOnChanges: true | |
| # Custom output directory | |
| outputDir: storybook-static | |
| # Skip build step since we're using buildScriptName | |
| skip: false |