Skip to content

Commit 7308569

Browse files
devmgnclaude
andcommitted
refactor(ci): consolidate chromatic workflow setup into shared action
- Add `setup-env` input parameter to setup action for conditional env file copy - Migrate chromatic.yml to use shared setup action with `setup-env: false` - Replace `.node-version` with `.tool-versions` for asdf compatibility - Chromatic now benefits from `--prefer-offline` optimization Co-Authored-By: Claude Opus 4.5 <[email protected]>
1 parent 4c6dfa4 commit 7308569

4 files changed

Lines changed: 13 additions & 12 deletions

File tree

.github/actions/setup/action.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
name: 'Setup'
22
description: 'Setup Node.js, pnpm, and install dependencies'
33

4+
inputs:
5+
setup-env:
6+
description: 'Whether to setup .env.local file'
7+
required: false
8+
default: 'true'
9+
410
runs:
511
using: 'composite'
612
steps:
@@ -10,13 +16,14 @@ runs:
1016
- name: Setup Node.js
1117
uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6
1218
with:
13-
node-version-file: '.node-version'
19+
node-version-file: '.tool-versions'
1420
cache: 'pnpm'
1521

1622
- name: Install dependencies
1723
shell: bash
1824
run: pnpm install --frozen-lockfile --prefer-offline
1925

2026
- name: Setup environment
27+
if: inputs.setup-env == 'true'
2128
shell: bash
2229
run: cp .env.development .env.local

.github/workflows/chromatic.yml

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,10 @@ jobs:
1616
with:
1717
fetch-depth: 0
1818

19-
- name: Install pnpm
20-
uses: pnpm/action-setup@v4
21-
22-
- name: Setup Node.js
23-
uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6
19+
- name: Setup
20+
uses: ./.github/actions/setup
2421
with:
25-
node-version-file: '.node-version'
26-
cache: 'pnpm'
27-
28-
- name: Install dependencies
29-
run: pnpm install --frozen-lockfile
22+
setup-env: 'false'
3023

3124
- name: Publish to Chromatic
3225
uses: chromaui/action@latest

.node-version

Lines changed: 0 additions & 1 deletion
This file was deleted.

.tool-versions

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node 24.13.0
2+
pnpm 10.28.0

0 commit comments

Comments
 (0)