Skip to content

Commit

Permalink
fix(ci): add back chromatic action
Browse files Browse the repository at this point in the history
  • Loading branch information
pawcoding committed Mar 23, 2024
1 parent eccec4a commit 8436c28
Show file tree
Hide file tree
Showing 4 changed files with 83 additions and 1 deletion.
71 changes: 71 additions & 0 deletions .github/workflows/chromatic.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: 🎨 Publish Storybook
# Run this on every push to master and pull request to master or staging
on:
push:
branches:
- master
pull_request:
branches:
- master
- staging
permissions:
contents: read
jobs:
publish:
# Skip this job if triggered by renovate bot
if: ${{ !startsWith(github.head_ref, 'renovate/')}}

# Use the latest version of Ubuntu
runs-on: ubuntu-latest
permissions:
contents: write
issues: write
pull-requests: write
steps:
# Checkout repository
- name: 📥 Checkout code
uses: actions/checkout@v4

# Setup Node
- name: 📦 Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20

# Install pnpm
- name: 📦 Install pnpm
uses: pnpm/action-setup@v3
with:
version: 8
run_install: false

# Get pnpm store directory
- name: 📦 Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
# Setup pnpm cache
- name: 📦 Setup pnpm cache
uses: actions/cache@v4
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
# Install dependencies
- name: 📦 Install dependencies
run: |
pnpm install --frozen-lockfile --prefer-frozen-lockfile
# Upload Storybook to Chromatic
- name: 🎨 Upload Storybook to Chromatic
uses: chromaui/action@latest
with:
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
buildScriptName: "storybook:build"
exitZeroOnChanges: true
exitOnceUploaded: true
env:
CI: true
8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,10 @@ testem.log
Thumbs.db

*storybook.log
documentation.json
documentation.json

# Chromatic
build-storybook.log
chromatic.log
chromatic-build-*.xml
chromatic-diagnostics.json
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"start": "ng serve",
"storybook": "ng run rainbow-palette:storybook",
"storybook:build": "ng run rainbow-palette:build-storybook",
"chromatic": "chromatic --build-script-name storybook:build --exit-zero-on-changes",
"test": "ng test",
"test:ci": "ng test --no-watch --no-progress --browsers=ChromeHeadless",
"watch": "ng build --watch --configuration development"
Expand Down Expand Up @@ -79,6 +80,7 @@
"@typescript-eslint/eslint-plugin": "7.2.0",
"@typescript-eslint/parser": "7.2.0",
"autoprefixer": "^10.4.18",
"chromatic": "^11.2.0",
"eslint": "^8.57.0",
"eslint-plugin-storybook": "^0.8.0",
"eslint-plugin-tailwindcss": "^3.15.1",
Expand Down
3 changes: 3 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 8436c28

Please sign in to comment.