mirror of
https://github.com/luxfi/bridge.git
synced 2026-09-24 00:26:46 +00:00
fix: build workspace deps in CI, bump @luxfi/core for xrp type
- Dockerfile: copy and build pkg/core before app/server - CI: build workspace dependencies before typecheck - server.yml: use root context for Docker build - Bump @luxfi/core to 10.0.6 (adds xrp NetworkType)
This commit is contained in:
@@ -5,11 +5,13 @@ on:
|
||||
branches: [ main, develop ]
|
||||
paths:
|
||||
- 'app/server/**'
|
||||
- 'pkg/core/**'
|
||||
- '.github/workflows/bridge-server.yml'
|
||||
pull_request:
|
||||
branches: [ main, develop ]
|
||||
paths:
|
||||
- 'app/server/**'
|
||||
- 'pkg/core/**'
|
||||
- '.github/workflows/bridge-server.yml'
|
||||
|
||||
jobs:
|
||||
@@ -52,6 +54,10 @@ jobs:
|
||||
run: |
|
||||
pnpm add -D @types/node winston
|
||||
|
||||
- name: Build workspace dependencies
|
||||
working-directory: ./pkg/core
|
||||
run: pnpm run build
|
||||
|
||||
- name: Run type check
|
||||
working-directory: ./app/server
|
||||
run: pnpm run typecheck
|
||||
|
||||
@@ -5,7 +5,8 @@ on:
|
||||
branches:
|
||||
- main
|
||||
paths:
|
||||
- 'app/server/**' # Only trigger the workflow for changes in the server directory
|
||||
- 'app/server/**'
|
||||
- 'pkg/core/**'
|
||||
jobs:
|
||||
build_and_deploy:
|
||||
runs-on: ubuntu-latest
|
||||
@@ -36,10 +37,9 @@ jobs:
|
||||
run: |
|
||||
docker login --username "${{ secrets.GH_USER }}" --password "${{ secrets.GH_TOKEN }}" ghcr.io
|
||||
|
||||
- name: Run Docker build and push with pnpm script
|
||||
- name: Run Docker build and push
|
||||
run: |
|
||||
docker buildx build --platform linux/amd64 -t ghcr.io/luxfi/bridge/server:latest -f docker/Dockerfile . --push
|
||||
working-directory: app/server
|
||||
docker buildx build --platform linux/amd64 -t ghcr.io/luxfi/bridge/server:latest -f app/server/Dockerfile . --push
|
||||
|
||||
- name: Set up kubectl
|
||||
uses: azure/setup-kubectl@v3
|
||||
|
||||
@@ -13,16 +13,19 @@ COPY pnpm-lock.yaml ./
|
||||
COPY pnpm-workspace.yaml ./
|
||||
COPY .npmrc* ./
|
||||
|
||||
# Copy app package.json
|
||||
# Copy workspace package.json files
|
||||
COPY app/server/package.json ./app/server/
|
||||
COPY pkg/core/package.json ./pkg/core/
|
||||
|
||||
# Install dependencies
|
||||
RUN pnpm install --no-frozen-lockfile
|
||||
|
||||
# Copy source code
|
||||
COPY pkg/core ./pkg/core
|
||||
COPY app/server ./app/server
|
||||
|
||||
# Build the application
|
||||
# Build workspace dependencies then the application
|
||||
RUN cd pkg/core && pnpm run build
|
||||
RUN cd app/server && pnpm run build
|
||||
|
||||
# Runtime stage
|
||||
@@ -46,12 +49,15 @@ COPY pnpm-lock.yaml ./
|
||||
COPY pnpm-workspace.yaml ./
|
||||
COPY .npmrc* ./
|
||||
|
||||
# Copy app package.json
|
||||
# Copy workspace package.json files
|
||||
COPY app/server/package.json ./app/server/
|
||||
COPY pkg/core/package.json ./pkg/core/
|
||||
|
||||
# Install production dependencies only
|
||||
RUN pnpm install --prod --no-frozen-lockfile
|
||||
|
||||
# Copy built workspace dependency
|
||||
COPY --from=builder --chown=bridge:nodejs /app/pkg/core/dist ./pkg/core/dist
|
||||
# Copy built application into workspace path so pnpm node_modules resolve correctly
|
||||
COPY --from=builder --chown=bridge:nodejs /app/app/server/dist ./app/server/dist
|
||||
# Copy prisma schema for generation
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@luxfi/core",
|
||||
"version": "10.0.4",
|
||||
"version": "10.0.6",
|
||||
"description": "Core types and shared utilities related to blockchain",
|
||||
"publishConfig": {
|
||||
"registry": "https://registry.npmjs.org/",
|
||||
|
||||
Reference in New Issue
Block a user