From 662e931e8b6bca560864c0b7c5a57a27bd67306c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Calcagno=20Lo=C3=AFc?= <98493858+CalcagnoLoic@users.noreply.github.com> Date: Thu, 8 Feb 2024 17:05:31 +0100 Subject: [PATCH] adding workflows to hosting on chromatic --- .github/workflows/chromatic.yaml | 24 ++++++++++++++++++++++++ package-lock.json | 31 +++++++++++++++++++++++++++++++ package.json | 1 + 3 files changed, 56 insertions(+) create mode 100644 .github/workflows/chromatic.yaml diff --git a/.github/workflows/chromatic.yaml b/.github/workflows/chromatic.yaml new file mode 100644 index 0000000..6eb0627 --- /dev/null +++ b/.github/workflows/chromatic.yaml @@ -0,0 +1,24 @@ +name: Deploy storybook on Chromatic + +on: + push: + branches: + - feature/chromatic + +jobs: + chromatic: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Install dependencies + run: npm ci + + - name: Publish to Chromatic + uses: chromaui/action@latest + with: + projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }} + exitZeroOnChanges: true \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index c29f6ce..551f953 100644 --- a/package-lock.json +++ b/package-lock.json @@ -26,6 +26,7 @@ "@typescript-eslint/parser": "^6.14.0", "@vitejs/plugin-react-swc": "^3.5.0", "autoprefixer": "^10.4.17", + "chromatic": "^10.9.1", "eslint": "^8.55.0", "eslint-plugin-react-hooks": "^4.6.0", "eslint-plugin-react-refresh": "^0.4.5", @@ -7781,6 +7782,29 @@ "node": ">=10" } }, + "node_modules/chromatic": { + "version": "10.9.1", + "resolved": "https://registry.npmjs.org/chromatic/-/chromatic-10.9.1.tgz", + "integrity": "sha512-6Ypho74fQu45ns48KaBuIMKqlzik0fJo//dLB3lkiphz8vCiMm75uU3xhkfZh4NbOS51MbWZKjPfefM53bIHpg==", + "dev": true, + "bin": { + "chroma": "dist/bin.js", + "chromatic": "dist/bin.js", + "chromatic-cli": "dist/bin.js" + }, + "peerDependencies": { + "@chromatic-com/cypress": "^0.5.2 || ^1.0.0", + "@chromatic-com/playwright": "^0.5.2 || ^1.0.0" + }, + "peerDependenciesMeta": { + "@chromatic-com/cypress": { + "optional": true + }, + "@chromatic-com/playwright": { + "optional": true + } + } + }, "node_modules/ci-info": { "version": "3.9.0", "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.9.0.tgz", @@ -20275,6 +20299,13 @@ "integrity": "sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==", "dev": true }, + "chromatic": { + "version": "10.9.1", + "resolved": "https://registry.npmjs.org/chromatic/-/chromatic-10.9.1.tgz", + "integrity": "sha512-6Ypho74fQu45ns48KaBuIMKqlzik0fJo//dLB3lkiphz8vCiMm75uU3xhkfZh4NbOS51MbWZKjPfefM53bIHpg==", + "dev": true, + "requires": {} + }, "ci-info": { "version": "3.9.0", "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.9.0.tgz", diff --git a/package.json b/package.json index fa9104b..a03a7aa 100644 --- a/package.json +++ b/package.json @@ -32,6 +32,7 @@ "@typescript-eslint/parser": "^6.14.0", "@vitejs/plugin-react-swc": "^3.5.0", "autoprefixer": "^10.4.17", + "chromatic": "^10.9.1", "eslint": "^8.55.0", "eslint-plugin-react-hooks": "^4.6.0", "eslint-plugin-react-refresh": "^0.4.5",