1
0
mirror of https://github.com/bitwarden/browser synced 2024-12-12 09:17:47 +01:00
bitwarden-estensione-browser/.github/workflows/chromatic.yml

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

68 lines
1.9 KiB
YAML
Raw Normal View History

---
2022-03-15 13:50:42 +01:00
name: Chromatic
2022-06-22 14:32:45 +02:00
on:
push:
branches:
- "main"
- "rc"
- "hotfix-rc"
pull_request_target:
types: [opened, synchronize]
2022-03-15 13:50:42 +01:00
jobs:
check-run:
name: Check PR run
uses: bitwarden/gh-actions/.github/workflows/check-run.yml@main
2022-03-15 13:50:42 +01:00
chromatic:
name: Chromatic
runs-on: ubuntu-22.04
needs: check-run
permissions:
contents: read
pull-requests: write
2022-03-15 13:50:42 +01:00
steps:
- name: Check out repo
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
- 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
uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4
2022-03-15 13:50:42 +01:00
with:
node-version: ${{ steps.retrieve-node-version.outputs.node_version }}
2022-03-15 13:50:42 +01:00
- name: Cache NPM
2022-03-15 13:50:42 +01:00
id: npm-cache
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
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
# Manually build the Storybook to resolve a 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
uses: chromaui/action@f4e60a7072abcac4203f4ca50613f28e199a52ba # v11.10.4
2022-03-15 13:50:42 +01:00
with:
token: ${{ secrets.GITHUB_TOKEN }}
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
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\"]"