WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Chore fix publish (#64) #32

Chore fix publish (#64)

Chore fix publish (#64) #32

Workflow file for this run

name: CI and Chromatic
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]
jobs:
ci:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
name: Install pnpm
with:
run_install: false
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
cache: "pnpm"
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Type check
run: pnpm run type-check
- name: Check formatting and linting
run: pnpm run check
- name: Run tests
run: pnpm run test:ci
- name: Build project
run: pnpm run build
chromatic:
runs-on: ubuntu-latest
needs: ci
if: github.event_name == 'pull_request' || github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master'
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
# Chromatic needs to know the git history to make sure it only runs changed components
fetch-depth: 0
- uses: pnpm/action-setup@v4
name: Install pnpm
with:
run_install: false
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
cache: "pnpm"
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Publish to Chromatic
uses: chromaui/action@v1
with:
# Chromatic project token. This value should be set in GitHub Secrets
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
# Build the Storybook static files using the existing script
buildScriptName: build-storybook
# The working directory that contains the package.json with the build-storybook script
workingDir: ./
# Only run this action on changed components
onlyChanged: true
# Automatically accept all changes on the main branch
autoAcceptChanges: ${{ github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' }}
# Exit with 0 on visual changes
exitZeroOnChanges: true
# Custom output directory
outputDir: storybook-static
# Skip build step since we're using buildScriptName
skip: false