From cff43dbe92a7b1854ac27e23db1dcda86262e4e2 Mon Sep 17 00:00:00 2001 From: Allan Lasser Date: Wed, 29 Nov 2023 14:51:38 -0500 Subject: [PATCH 1/2] Adds Chromatic build as GitHub Action --- .github/workflows/chromatic.yml | 26 ++++++++++++++++++++++++++ package-lock.json | 12 ++++++++++++ package.json | 3 ++- 3 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/chromatic.yml diff --git a/.github/workflows/chromatic.yml b/.github/workflows/chromatic.yml new file mode 100644 index 000000000..f03eb68f7 --- /dev/null +++ b/.github/workflows/chromatic.yml @@ -0,0 +1,26 @@ +# .github/workflows/chromatic.yml + +# Workflow name +name: "Chromatic" + +# Event for the workflow +on: push + +jobs: + chromatic-deployment: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v3 + with: + fetch_depth: 0 # Required to retrieve git history + - name: Use Node v18 + uses: actions/setup-node@v3 + with: + node-version: 18 + - name: Install dependencies + run: npm ci + - name: Publish to Chromatic + uses: chromaui/action@v1 + with: + projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }} diff --git a/package-lock.json b/package-lock.json index 2a77e8888..36bde8041 100644 --- a/package-lock.json +++ b/package-lock.json @@ -69,6 +69,7 @@ "@storybook/svelte": "^7.5.3", "@storybook/svelte-webpack5": "^7.5.3", "@storybook/testing-library": "^0.2.2", + "chromatic": "^9.1.0", "eslint": "^7.32.0", "jest": "^29.6.3", "jest-environment-jsdom": "^29.7.0", @@ -8648,6 +8649,17 @@ "node": ">=10" } }, + "node_modules/chromatic": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/chromatic/-/chromatic-9.1.0.tgz", + "integrity": "sha512-9ib8k4LIfg/88kKufxz1N8vgCB7nlLhJqmx+Vx55cM/6DCB/M6oqroirVRXfdeC7qaZuhyUemPF2QHxBh7GXtQ==", + "dev": true, + "bin": { + "chroma": "dist/bin.js", + "chromatic": "dist/bin.js", + "chromatic-cli": "dist/bin.js" + } + }, "node_modules/chrome-trace-event": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/chrome-trace-event/-/chrome-trace-event-1.0.3.tgz", diff --git a/package.json b/package.json index 1d7ce30b9..6872e6042 100644 --- a/package.json +++ b/package.json @@ -35,7 +35,7 @@ "rlite-router": "^2.0.3", "sass": "^1.60.0", "sass-loader": "^13.3.2", - "scrollzoom": "MuckRock/scrollzoom", + "scrollzoom": "github:MuckRock/scrollzoom", "style-loader": "^3.3.3", "svelte": "^4.0.0", "svelte-i18n": "^4.0.0", @@ -64,6 +64,7 @@ "@storybook/svelte": "^7.5.3", "@storybook/svelte-webpack5": "^7.5.3", "@storybook/testing-library": "^0.2.2", + "chromatic": "^9.1.0", "eslint": "^7.32.0", "jest": "^29.6.3", "jest-environment-jsdom": "^29.7.0", From 177b04806b8bfd0106837af98bba0eaee3a09105 Mon Sep 17 00:00:00 2001 From: Allan Lasser Date: Wed, 29 Nov 2023 14:54:10 -0500 Subject: [PATCH 2/2] Fixes `fetch-depth` checkout setting --- .github/workflows/chromatic.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/chromatic.yml b/.github/workflows/chromatic.yml index f03eb68f7..d98e896a6 100644 --- a/.github/workflows/chromatic.yml +++ b/.github/workflows/chromatic.yml @@ -11,9 +11,9 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: - fetch_depth: 0 # Required to retrieve git history + fetch-depth: 0 # Required to retrieve git history - name: Use Node v18 uses: actions/setup-node@v3 with: