@ -88,75 +88,62 @@ jobs:
if : steps.get-changed-files.outputs.storyFiles == 'true'
run : npm ci
- name : Get branch name
id : branch-names
env :
EVENT_NAME : ${{ github.event_name }}
HEAD_REF : ${{ github.event.pull_request.head.ref || github.head_ref }}
REF_NAME : ${{ github.ref_name }}
run : |
# Get branch name based on event type
if [[ "$EVENT_NAME" == *"pull_request"* ]]; then
BRANCH_NAME="$HEAD_REF"
else
BRANCH_NAME="$REF_NAME"
fi
# Replace slashes with hyphens
BRANCH_NAME_NORMALIZED="${BRANCH_NAME//\//-}"
echo "current_branch=$BRANCH_NAME_NORMALIZED" >> "$GITHUB_OUTPUT"
shell : bash
# Manually build the Storybook to resolve a bug related to TurboSnap
- name : Build CL Storybook
if : steps.get-changed-files.outputs.storyFiles == 'true'
env:
STORYBOOK_BRANCH_NAME : ${{ steps.branch-names.outputs.current_branch }}
run : npm run build-storybook:ci
- name : Build Autofill Storybook
if : steps.get-changed-files.outputs.storyFiles == 'true'
run : npm run build-storybook:autofill:ci
- name : Log in to Azure
if : steps.get-changed-files.outputs.storyFiles == 'true'
uses : bitwarden/gh-actions/azure-login@main
with:
subscription_id : ${{ secrets.AZURE_SUBSCRIPTION_ID }}
tenant_id : ${{ secrets.AZURE_TENANT_ID }}
client_id : ${{ secrets.AZURE_CLIENT_ID }}
- name : Get Azure Key Vault secrets
if : steps.get-changed-files.outputs.storyFiles == 'true'
id : get-kv-secrets
uses : bitwarden/gh-actions/get-keyvault-secrets@main
with:
keyvault : gh-clients
secrets : "CHROMATIC-PROJECT-TOKEN,CHROMATIC-PROJECT-TOKEN-AUTOFILL"
- name : Log out from Azure
if : steps.get-changed-files.outputs.storyFiles == 'true'
uses : bitwarden/gh-actions/azure-logout@main
- name : Publish to Chromatic for CL
# Manually build the Storybook to resolve a bug related to TurboSnap
- name : Build Autofill Storybook
if : steps.get-changed-files.outputs.storyFiles == 'true'
run : npm run build-storybook:autofill:ci
- name : Publish to Chromatic for Autofill
id : publish-chromatic-autofill
uses : chromaui/action@ac86f2ff0a458ffbce7b40698abd44c0fa34d4b6 # v13.3.3
with:
token : ${{ secrets.GITHUB_TOKEN }}
projectToken : ${{ steps.get-kv-secrets.outputs.CHROMATIC-PROJECT-TOKEN }}
storybookBuildDir : ./storybook-static
projectToken : ${{ steps.get-kv-secrets.outputs.CHROMATIC-PROJECT-TOKEN-AUTOFILL }}
storybookBaseDir : ./apps/browser/src/autofill/content/components
storybookBuildDir : ./apps/browser/src/autofill/content/components/storybook-static
exitOnceUploaded : true
onlyChanged : true
externals : |
libs/components/**/*.scss
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.outputs.storyFiles == 'false' }}
- name : Publish to Chromatic for Autofill
# Manually build the Storybook to resolve a bug related to TurboSnap
- name : Build CL Storybook
if : steps.get-changed-files.outputs.storyFiles == 'true'
env:
AUTOFILL_CHROMATIC_URL : ${{ steps.publish-chromatic-autofill.outputs.storybookUrl }}
run : npm run build-storybook:ci
- name : Publish to Chromatic for CL
uses : chromaui/action@ac86f2ff0a458ffbce7b40698abd44c0fa34d4b6 # v13.3.3
with:
token : ${{ secrets.GITHUB_TOKEN }}
projectToken : ${{ steps.get-kv-secrets.outputs.CHROMATIC-PROJECT-TOKEN-AUTOFILL }}
storybookBaseDir : ./apps/browser/src/autofill/content/components
storybookBuildDir : ./apps/browser/src/autofill/content/components/storybook-static
projectToken : ${{ steps.get-kv-secrets.outputs.CHROMATIC-PROJECT-TOKEN }}
storybookBuildDir : ./storybook-static
exitOnceUploaded : true
onlyChanged : true
externals : |
libs/components/**/*.scss
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.outputs.storyFiles == 'false' }}
skip : ${{ steps.get-changed-files.outputs.storyFiles == 'false' }}