2022-03-15 13:50:42 +01:00
|
|
|
---
|
|
|
|
name: Chromatic
|
|
|
|
|
2022-06-22 14:32:45 +02:00
|
|
|
on:
|
|
|
|
push:
|
2024-01-04 16:38:53 +01:00
|
|
|
branches-ignore:
|
|
|
|
- 'renovate/**'
|
2022-06-22 14:32:45 +02:00
|
|
|
paths-ignore:
|
|
|
|
- '.github/workflows/**'
|
2022-03-15 13:50:42 +01:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
chromatic:
|
|
|
|
name: Chromatic
|
|
|
|
runs-on: ubuntu-20.04
|
|
|
|
|
|
|
|
steps:
|
2023-10-05 00:01:44 +02:00
|
|
|
- name: Checkout repo
|
|
|
|
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
|
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
|
|
|
|
2023-10-04 18:23:40 +02:00
|
|
|
- name: Get Node Version
|
|
|
|
id: retrieve-node-version
|
|
|
|
run: |
|
|
|
|
NODE_NVMRC=$(cat .nvmrc)
|
|
|
|
NODE_VERSION=${NODE_NVMRC/v/''}
|
|
|
|
echo "node_version=$NODE_VERSION" >> $GITHUB_OUTPUT
|
|
|
|
|
2022-03-15 13:50:42 +01:00
|
|
|
- name: Set up Node
|
2023-05-09 18:38:11 +02:00
|
|
|
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
|
2022-03-15 13:50:42 +01:00
|
|
|
with:
|
2023-10-04 18:23:40 +02:00
|
|
|
node-version: ${{ steps.retrieve-node-version.outputs.node_version }}
|
2022-03-15 13:50:42 +01:00
|
|
|
|
|
|
|
- name: Cache npm
|
|
|
|
id: npm-cache
|
2023-05-05 22:17:19 +02:00
|
|
|
uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1
|
2022-03-15 13:50:42 +01:00
|
|
|
with:
|
|
|
|
path: "~/.npm"
|
|
|
|
key: ${{ runner.os }}-npm-chromatic-${{ hashFiles('**/package-lock.json') }}
|
|
|
|
|
|
|
|
- name: Install Node dependencies
|
|
|
|
run: npm ci
|
2023-10-04 18:23:40 +02:00
|
|
|
|
2023-05-26 15:58:06 +02:00
|
|
|
# Manual build the storybook to resolve a chromatic/storybook bug related to TurboSnap
|
|
|
|
- name: Build Storybook
|
|
|
|
run: npm run build-storybook:ci
|
2022-03-15 13:50:42 +01:00
|
|
|
|
|
|
|
- name: Publish to Chromatic
|
2023-12-05 13:16:01 +01:00
|
|
|
uses: chromaui/action@2f12dc37555ffc9ed980d883e96b6d03724a2d6a # v10.0.0
|
2022-03-15 13:50:42 +01:00
|
|
|
with:
|
|
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
|
2023-05-26 15:58:06 +02:00
|
|
|
storybookBuildDir: ./storybook-static
|
2022-03-15 13:50:42 +01:00
|
|
|
exitOnceUploaded: true
|
|
|
|
onlyChanged: true
|
2023-09-14 18:31:48 +02:00
|
|
|
externals: "[\"libs/components/**/*.scss\", \"libs/components/**/*.css\", \"libs/components/tailwind.config*.js\"]"
|