PromucFlow_constructor/.github/workflows/build-chromatic.yml
Arpit Mohan 2650ea161d
ci: Updating actions/checkout to v4 and defaulting to fetch-depth 1 instead of 0 (#29281)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

- **Chores**
- Updated GitHub Actions workflows to use `actions/checkout@v4` for
improved performance and reliability.
- Removed `fetch-depth` parameter to simplify checkout steps across
various workflows.
  - Standardized quote usage for consistency in workflow files.

- **Documentation**
- Adjusted formatting and descriptions in workflow files for better
clarity and readability.

- **Refactor**
- Aligned multiple workflow files to follow a consistent structure and
naming convention.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

fetch-depth 0 causes the Github workflow to checkout the entire Git
history. This is not required. We only need to check out the head of the
commit. By default, actions/checkout has fetch-depth=1, hence removing
it from the workflow completely for simplicity.
2023-12-05 13:44:43 +05:30

52 lines
1.4 KiB
YAML

name: "Build Storybook - UI Tests with Chromatic"
on:
push:
branches:
- release
paths:
- "app/client/packages/design-system/**"
- "app/client/packages/storybook/**"
pull_request:
paths:
- "app/client/packages/design-system/**"
- "app/client/packages/storybook/**"
jobs:
chromatic-deployment:
runs-on: ubuntu-latest
steps:
- name: Checkout PR if pull_request event
if: github.event_name == 'pull_request'
uses: actions/checkout@v4
with:
ref: refs/pull/${{ github.event.pull_request.number }}/merge
- name: Checkout PR if push event
if: github.event_name == 'push'
uses: actions/checkout@v4
with:
ref: release
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version-file: app/client/package.json
- name: Install Dependencies
working-directory: ./app/client/packages/storybook
run: yarn install --immutable
- name: Publish to Chromatic
id: chromatic-publish
uses: chromaui/action@v1
env:
CHROMATIC: 1
with:
token: ${{ secrets.GITHUB_TOKEN }}
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
workingDir: ./app/client/packages/storybook
exitOnceUploaded: true
buildScriptName: "build"