BPScott / storybook-action

A GitHub action to run Percy with Storybook

Home Page:https://docs.percy.io/docs/github-actions#section-storybook-action

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Percy for Storybook

A GitHub action to visually test Storybook with Percy.

Quick start

To use the Percy exec GitHub action you will need to add a new step to your actions config using the percy/storybook-action action. Using the default settings, you can just use the action directly. You will also need to set your PERCY_TOKEN in your GitHub projects settings.

This is a sample config using the default setup:

name: CI
on: [push, pull_request]
jobs:
  default:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@master
      - name: Install
        run: yarn
      - name: Percy Test
        uses: percy/storybook-action@v0.1.1
        env:
          PERCY_TOKEN: ${{ secrets.PERCY_TOKEN }}

And this is a setup that passes a custom command, which allows for any configuration:

name: CI
on: [push, pull_request]
jobs:
  custom_command:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@master
      - name: Install
        run: yarn
      - name: Percy Test
        uses: percy/storybook-action@v0.1.1
        with:
          custom-command: 'yarn storybook:percy'
        env:
          PERCY_TOKEN: ${{ secrets.PERCY_TOKEN }}

About

A GitHub action to run Percy with Storybook

https://docs.percy.io/docs/github-actions#section-storybook-action

License:MIT License


Languages

Language:JavaScript 88.9%Language:HTML 6.6%Language:CSS 4.4%