Skip to content

Commit 0ef79e7

Browse files
committed
ci(web-client): update Netlify and GitHub Actions for the npm workspace
1 parent b5dabca commit 0ef79e7

File tree

3 files changed

+16
-6
lines changed

3 files changed

+16
-6
lines changed

.github/workflows/web-client.yaml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ concurrency:
99

1010
defaults:
1111
run:
12-
working-directory: web-client
12+
working-directory: web-client-workspace/web-client
1313

1414
jobs:
1515
test:
@@ -36,6 +36,8 @@ jobs:
3636
${{ runner.os }}-npm-
3737
3838
- name: Install dependencies (NPM)
39+
# NOTE: For npm's workspace support, the install command must be run from the workspace root.
40+
working-directory: web-client-workspace
3941
# XXX(Pi): "npm ci" is currently broken: <https://github.com/npm/cli/issues/3947>
4042
# Work around this by using "npm install" followed by a git working copy check.
4143
run: |
@@ -110,14 +112,20 @@ jobs:
110112
${{ runner.os }}-npm-
111113
112114
- name: Install dependencies (NPM)
113-
run: npm ci
115+
# NOTE: For npm's workspace support, the install command must be run from the workspace root.
116+
working-directory: web-client-workspace
117+
# XXX(Pi): "npm ci" is currently broken: <https://github.com/npm/cli/issues/3947>
118+
# Work around this by using "npm install" followed by a git working copy check.
119+
run: |
120+
npm install
121+
git diff --exit-code
114122
115123
# TODO: Factor out the steps above, somehow.
116124

117125
# Docs: https://www.chromatic.com/docs/github-actions
118126
- name: Publish to Chromatic
119127
uses: chromaui/action@v1
120128
with:
121-
workingDir: web-client
129+
workingDir: web-client-workspace/web-client
122130
token: ${{ secrets.GITHUB_TOKEN }}
123131
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}

netlify.toml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
# Docs: https://docs.netlify.com/configure-builds/file-based-configuration/
22

33
[build]
4-
base = "web-client"
5-
publish = "www"
6-
command = "npm run build:prod"
4+
# NOTE: Build the whole workspace, to include the SDK libraries.
5+
base = "web-client-workspace"
6+
publish = "web-client/www"
7+
command = "npm run --workspace web-client build:prod"
78

89
# Set fallback
910
#

web-client-workspace/.node-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
16.13.1

0 commit comments

Comments
 (0)