99 build :
1010 name : Build packages
1111 runs-on : ubuntu-latest
12+ outputs :
13+ cache-primary-key : ${{ steps.build-cache.outputs.cache-primary-key }}
1214 steps :
1315 - uses : actions/checkout@v4
1416
17+ - name : pnpm
18+ uses : pnpm/action-setup@v4
19+ with :
20+ version : 9.15.0
21+
1522 # Needed following Github's transition from Node 16 to 20
1623 - name : Install node-gyp
1724 run : pnpm add --global node-gyp
1825
19- - uses : actions/cache@v4
26+ - uses : actions/cache/restore @v4
2027 name : Check for build cache
2128 id : build-cache
2229 with :
2734 tools/*/dist/*
2835 **/tsdoc.json
2936 **/stories.js
30- key : ${{ runner.os }}-build-cache-${{ hashFiles('package.json', 'pnpm-lock.yaml', '**/src/', '!**/node_modules', '!**/dist' ) }}
37+ key : ${{ runner.os }}-build-cache-${{ hashFiles('package.json', 'pnpm-lock.yaml', '**/src/') }}
3138
3239 # Only setup & build if there was no build cache hit
3340 - name : Use Node 18
5057 if : ${{ steps.build-cache.outputs.cache-hit != 'true' }}
5158 run : pnpm run turbo run docs
5259
60+ - uses : actions/cache/save@v4
61+ name : Save build cache
62+ if : ${{ steps.build-cache.outputs.cache-hit != 'true' }}
63+ with :
64+ path : |
65+ charts/*/dist/*
66+ chat/*/dist/*
67+ packages/*/dist/*
68+ tools/*/dist/*
69+ key : ${{ steps.build-cache.outputs.cache-primary-key }}
70+
5371 chromatic :
5472 name : Establish Chromatic baseline
5573 runs-on : ubuntu-latest
85103 tools/*/dist/*
86104 **/tsdoc.json
87105 **/stories.js
88- key : ${{ runner.os }}- build- cache-${{ hashFiles('package.json', 'pnpm-lock.yaml', '**/src/', '!**/node_modules', '!**/dist') }}
106+ key : ${{needs. build.outputs. cache-primary-key }}
89107
90108 - name : Publish to Chromatic
91109 uses : chromaui/action@v1
@@ -132,7 +150,7 @@ jobs:
132150 tools/*/dist/*
133151 **/tsdoc.json
134152 **/stories.js
135- key : ${{ runner.os }}- build- cache-${{ hashFiles('package.json', 'pnpm-lock.yaml', '**/src/', '!**/node_modules', '!**/dist') }}
153+ key : ${{needs. build.outputs. cache-primary-key }}
136154
137155 - name : Version packages
138156 id : changesets
@@ -147,7 +165,7 @@ jobs:
147165 notify :
148166 name : Notify Slack & Website
149167 runs-on : ubuntu-latest
150- needs : [release]
168+ needs : [build, release]
151169 if : ${{ needs.release.outputs.published == 'true' }}
152170 steps :
153171 - uses : actions/checkout@v4
@@ -175,13 +193,14 @@ jobs:
175193 tools/*/dist/*
176194 **/tsdoc.json
177195 **/stories.js
178- key : ${{ runner.os }}- build- cache-${{ hashFiles('package.json', 'pnpm-lock.yaml', '**/src/', '!**/node_modules', '!**/dist') }}
196+ key : ${{needs. build.outputs. cache-primary-key }}
179197
180198 - name : Notify Slack channel of new releases
181199 id : slackbot
182200 run : pnpm slackbot '${{ needs.release.outputs.publishedPackages }}'
183201 env :
184202 SLACK_BOT_TOKEN : ' ${{ secrets.SLACK_BOT_TOKEN }}'
203+
185204 dispatch-to-website :
186205 name : Dispatch to Website repo
187206 runs-on : ubuntu-latest
0 commit comments