change file #138
Workflow file for this run
This file contains 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" | |
on: push | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }}-chromatic | |
cancel-in-progress: true | |
permissions: | |
actions: write | |
contents: read | |
jobs: | |
changed-files: | |
runs-on: ubuntu-latest | |
name: changed-files | |
outputs: | |
all_changed_files: ${{ steps.changed-files.outputs.all_changed_files }} | |
any_changed: ${{ steps.changed-files.outputs.any_changed }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Get changed files | |
id: changed-files | |
uses: tj-actions/changed-files@v44 | |
with: | |
files: | | |
**/** | |
- name: List all changed files | |
env: | |
ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }} | |
ANY_CHANGED: ${{ steps.changed-files.outputs.any_changed }} | |
run: | | |
for file in ${ALL_CHANGED_FILES}; do | |
echo "$file was changed" | |
echo Did any files change: ${ANY_CHANGED} | |
done | |
chromatic: | |
name: Run Chromatic | |
runs-on: ubuntu-latest | |
needs: [changed-files] | |
if: ${{ needs.changed-files.outputs.any_changed == 'true' }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- uses: actions/setup-node@v4 | |
with: | |
cache: npm | |
cache-dependency-path: ./package.json | |
node-version: 22 | |
- name: Install dependencies | |
working-directory: ./webapp | |
run: npm install | |
- name: Run Chromatic | |
id: chromatic | |
uses: chromaui/action@latest | |
with: | |
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }} | |
autoAcceptChanges: "develop" | |
workingDir: webapp | |
exitZeroOnChanges: true | |
exitOnceUploaded: true | |
onlyChanged: true | |
skip: "dependabot/**" | |
- name: Publish Summary | |
run: echo -e "| Results | |\n| --- | --- |\n| Build Results | ${{ steps.chromatic.outputs.buildUrl }} |\n| Storybook Preview | ${{ steps.chromatic.outputs.storybookUrl }} |\n| Component Count | ${{steps.chromatic.outputs.componentCount}} |" >> $GITHUB_STEP_SUMMARY |