Skip to content

Commit

Permalink
Merge pull request #99 from storybookjs/tech/use-action
Browse files Browse the repository at this point in the history
Tech/use action
  • Loading branch information
kylesuss authored Oct 18, 2019
2 parents d0a1dc8 + 010ff0f commit a69481c
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 9 deletions.
29 changes: 21 additions & 8 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,40 @@
version: 2

jobs:
lint:
docker:
- image: circleci/node:10
working_directory: ~/repo
steps:
- checkout
- restore_cache:
keys:
- v1-dependencies-{{ checksum "package.json" }}
- v1-dependencies-
- run: yarn install
- run: yarn lint
build:
docker:
- image: circleci/node:10

working_directory: ~/repo

steps:
- checkout

- restore_cache:
keys:
- v1-dependencies-{{ checksum "package.json" }}
- v1-dependencies-

- run: yarn install

- save_cache:
paths:
- node_modules
key: v1-dependencies-{{ checksum "package.json" }}

# - run: yarn lint

- run: yarn build
- run: yarn build-storybook
- run: yarn chromatic --storybook-build-dir storybook-static --exit-zero-on-changes

workflows:
version: 2
lint-build:
jobs:
- build
- lint
21 changes: 21 additions & 0 deletions .github/workflows/chromatic.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: "Chromatic"
on:
pull_request:

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- run: |
yarn
- run: |
yarn build
- run: |
yarn build-storybook
- uses: chromaui/action@v1
with:
appCode: ${{ secrets.CHROMATIC_APP_CODE }}
token: ${{ secrets.GITHUB_TOKEN }}
storybookBuildDir: storybook-static

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
"build": "babel src -d dist",
"build-docs": "build-storybook --docs",
"build-storybook": "build-storybook",
"chromatic": "CHROMATIC_APP_CODE=9ofhn0iql7n chromatic test",
"lint": "eslint .",
"lint:js": "cross-env NODE_ENV=production eslint --cache --cache-location=.cache/eslint --ext .js,.jsx,.html,.ts,.tsx,.mjs --report-unused-disable-directives",
"lint:package": "sort-package-json",
Expand Down

0 comments on commit a69481c

Please sign in to comment.