Skip to content

Commit 69d5997

Browse files
Fix CI: use root lockfile and npm workspaces for web builds
1 parent 6a675ad commit 69d5997

2 files changed

Lines changed: 19 additions & 12 deletions

File tree

.github/workflows/ci.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,13 +109,13 @@ jobs:
109109
with:
110110
node-version: "20"
111111
cache: "npm"
112-
cache-dependency-path: packages/web/package.json
112+
cache-dependency-path: package-lock.json
113113

114114
- name: Install dependencies
115-
run: cd packages/web && npm install
115+
run: npm ci --workspace packages/web
116116

117117
- name: Type check
118-
run: cd packages/web && npm run type-check
118+
run: npm run type-check --workspace packages/web
119119

120120
- name: Lint
121-
run: cd packages/web && npm run lint
121+
run: npm run lint --workspace packages/web

.github/workflows/publish.yml

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,24 +23,31 @@ jobs:
2323
with:
2424
node-version: "20"
2525
cache: "npm"
26-
cache-dependency-path: packages/web/package-lock.json
26+
cache-dependency-path: package-lock.json
2727

2828
- name: Install dependencies
29-
run: cd packages/web && npm install
29+
run: npm ci --workspace packages/web
3030

3131
- name: Build Next.js (standalone)
32-
run: cd packages/web && npm run build
32+
run: npm run build --workspace packages/web
3333
env:
3434
NEXT_PUBLIC_REPOWISE_API_URL: ""
3535

3636
- name: Package standalone output
3737
run: |
38-
cd packages/web/.next/standalone
39-
# Copy static files into standalone (Next.js requirement)
40-
cp -r ../../.next/static .next/static
41-
[ -d ../../public ] && cp -r ../../public public || true
38+
STANDALONE=packages/web/.next/standalone
39+
# Copy static assets into standalone (Next.js requirement)
40+
cp -r packages/web/.next/static $STANDALONE/packages/web/.next/static
41+
[ -d packages/web/public ] && cp -r packages/web/public $STANDALONE/packages/web/public || true
42+
# Flatten: move the nested server into a clean directory
43+
mkdir -p /tmp/repowise-web
44+
cp $STANDALONE/packages/web/server.js /tmp/repowise-web/
45+
cp -r $STANDALONE/packages/web/.next /tmp/repowise-web/.next
46+
[ -d $STANDALONE/packages/web/public ] && cp -r $STANDALONE/packages/web/public /tmp/repowise-web/public || true
47+
cp -r $STANDALONE/node_modules /tmp/repowise-web/node_modules 2>/dev/null || true
48+
[ -d $STANDALONE/packages/web/node_modules ] && cp -r $STANDALONE/packages/web/node_modules/* /tmp/repowise-web/node_modules/ 2>/dev/null || true
4249
# Create tarball
43-
tar -czf /tmp/repowise-web.tar.gz .
50+
cd /tmp/repowise-web && tar -czf /tmp/repowise-web.tar.gz .
4451
4552
- name: Upload web artifact
4653
uses: actions/upload-artifact@v4

0 commit comments

Comments
 (0)