mirror of
https://github.com/bitwarden/browser
synced 2026-02-11 05:53:42 +00:00
[CL-695] Combine display of CL and autofill storybooks
This commit is contained in:
39
.github/workflows/chromatic.yml
vendored
39
.github/workflows/chromatic.yml
vendored
@@ -37,8 +37,8 @@ jobs:
|
||||
fetch-depth: 0
|
||||
persist-credentials: false
|
||||
|
||||
- name: Get changed files
|
||||
id: get-changed-files-for-chromatic
|
||||
- name: Get changed files for CL project
|
||||
id: get-changed-files-for-chromatic-cl
|
||||
uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
|
||||
with:
|
||||
filters: |
|
||||
@@ -49,9 +49,17 @@ jobs:
|
||||
- "package.json"
|
||||
- ".storybook/**"
|
||||
|
||||
- name: Get changed files for autofill project
|
||||
id: get-changed-files-for-chromatic-autofill
|
||||
uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
|
||||
with:
|
||||
filters: |
|
||||
storyFiles:
|
||||
- "apps/browser/src/autofill/content/components/**"
|
||||
|
||||
- name: Get Node version
|
||||
id: retrieve-node-version
|
||||
if: steps.get-changed-files-for-chromatic.outputs.storyFiles == 'true'
|
||||
if: steps.get-changed-files-for-chromatic-cl.outputs.storyFiles == 'true' || steps.get-changed-files-for-chromatic-autofill == 'true'
|
||||
run: |
|
||||
NODE_NVMRC=$(cat .nvmrc)
|
||||
NODE_VERSION=${NODE_NVMRC/v/''}
|
||||
@@ -61,7 +69,7 @@ jobs:
|
||||
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
|
||||
with:
|
||||
node-version: ${{ steps.retrieve-node-version.outputs.node_version }}
|
||||
if: steps.get-changed-files-for-chromatic.outputs.storyFiles == 'true'
|
||||
if: steps.get-changed-files-for-chromatic-cl.outputs.storyFiles == 'true' || steps.get-changed-files-for-chromatic-autofill == 'true'
|
||||
|
||||
- name: Cache NPM
|
||||
id: npm-cache
|
||||
@@ -69,15 +77,15 @@ jobs:
|
||||
with:
|
||||
path: "~/.npm"
|
||||
key: ${{ runner.os }}-npm-chromatic-${{ hashFiles('**/package-lock.json') }}
|
||||
if: steps.get-changed-files-for-chromatic.outputs.storyFiles == 'true'
|
||||
if: steps.get-changed-files-for-chromatic-cl.outputs.storyFiles == 'true' || steps.get-changed-files-for-chromatic-autofill == 'true'
|
||||
|
||||
- name: Install Node dependencies
|
||||
if: steps.get-changed-files-for-chromatic.outputs.storyFiles == 'true'
|
||||
if: steps.get-changed-files-for-chromatic-cl.outputs.storyFiles == 'true' || steps.get-changed-files-for-chromatic-autofill == 'true'
|
||||
run: npm ci
|
||||
|
||||
# Manually build the Storybook to resolve a bug related to TurboSnap
|
||||
- name: Build Storybook
|
||||
if: steps.get-changed-files-for-chromatic.outputs.storyFiles == 'true'
|
||||
if: steps.get-changed-files-for-chromatic-cl.outputs.storyFiles == 'true' || steps.get-changed-files-for-chromatic-autofill == 'true'
|
||||
run: npm run build-storybook:ci
|
||||
|
||||
- name: Log in to Azure
|
||||
@@ -92,12 +100,12 @@ jobs:
|
||||
uses: bitwarden/gh-actions/get-keyvault-secrets@main
|
||||
with:
|
||||
keyvault: gh-clients
|
||||
secrets: "CHROMATIC-PROJECT-TOKEN"
|
||||
secrets: "CHROMATIC-PROJECT-TOKEN,CHROMATIC-PROJECT-TOKEN-AUTOFILL"
|
||||
|
||||
- name: Log out from Azure
|
||||
uses: bitwarden/gh-actions/azure-logout@main
|
||||
|
||||
- name: Publish to Chromatic
|
||||
- name: Publish to Chromatic for CL
|
||||
uses: chromaui/action@ac86f2ff0a458ffbce7b40698abd44c0fa34d4b6 # v13.3.3
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
@@ -110,4 +118,15 @@ jobs:
|
||||
libs/components/**/*.css
|
||||
libs/components/tailwind.config*.js
|
||||
# Rather than use an `if` check on the whole publish step, we need to tell Chromatic to skip so that any Chromatic-spawned actions are properly skipped
|
||||
skip: ${{ steps.get-changed-files-for-chromatic.outputs.storyFiles == 'false' }}
|
||||
skip: ${{ steps.get-changed-files-for-chromatic-cl.outputs.storyFiles == 'false' }}
|
||||
|
||||
- name: Publish to Chromatic for Autofill
|
||||
uses: chromaui/action@ac86f2ff0a458ffbce7b40698abd44c0fa34d4b6 # v13.3.3
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
projectToken: ${{ steps.get-kv-secrets.outputs.CHROMATIC-PROJECT-TOKEN-AUTOFILL }}
|
||||
storybookBuildDir: ./apps/browser/src/autofill/content/components/storybook-static
|
||||
exitOnceUploaded: true
|
||||
onlyChanged: true
|
||||
# Rather than use an `if` check on the whole publish step, we need to tell Chromatic to skip so that any Chromatic-spawned actions are properly skipped
|
||||
skip: ${{ steps.get-changed-files-for-chromatic-autofill.outputs.storyFiles == 'false' }}
|
||||
Reference in New Issue
Block a user