diff --git a/.circleci/config.yml b/.circleci/config.yml index 1b9cd032..86495812 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,8 +1,24 @@ version: 2 jobs: - build: + lint: docker: - - image: circleci/node:8.10.0 + - 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 + chromatic: + docker: + - image: circleci/node:10 working_directory: ~/repo @@ -21,7 +37,5 @@ jobs: - 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 diff --git a/.github/workflows/chromatic.yml b/.github/workflows/chromatic.yml new file mode 100755 index 00000000..38aaf39e --- /dev/null +++ b/.github/workflows/chromatic.yml @@ -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 + diff --git a/package.json b/package.json index f68796e0..bf5cff85 100644 --- a/package.json +++ b/package.json @@ -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",