diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml index 58a4e16..a78823c 100644 --- a/.github/workflows/docker-build.yml +++ b/.github/workflows/docker-build.yml @@ -32,7 +32,12 @@ jobs: uses: docker/setup-qemu-action@v3 - name: Set up Docker Buildx + id: buildx uses: docker/setup-buildx-action@v3 + with: + driver-opts: | + memory=8g + memory-swap=16g - name: Log in to GitHub Container Registry if: github.event_name != 'pull_request' @@ -69,6 +74,9 @@ jobs: build-args: | BUILDKIT_INLINE_CACHE=1 provenance: false + # Add build constraints to prevent OOM + builder: ${{ steps.buildx.outputs.name }} + no-cache-filters: db-builder # Nginx build commented out until Phase 2 # build-nginx: diff --git a/.github/workflows/update-n8n-deps.yml b/.github/workflows/update-n8n-deps.yml index ea907c0..878d24e 100644 --- a/.github/workflows/update-n8n-deps.yml +++ b/.github/workflows/update-n8n-deps.yml @@ -42,8 +42,15 @@ jobs: - name: Check for updates (dry run) id: check run: | + # Ensure we're in the right directory + cd ${{ github.workspace }} + # First do a dry run to check if updates are needed - node scripts/update-n8n-deps.js --dry-run > update-check.log 2>&1 + node scripts/update-n8n-deps.js --dry-run > update-check.log 2>&1 || { + echo "❌ Error running update check:" + cat update-check.log + exit 1 + } # Check if updates are available if grep -q "update available" update-check.log; then @@ -61,8 +68,14 @@ jobs: if: steps.check.outputs.updates_available == 'true' id: update run: | + # Ensure we're in the right directory + cd ${{ github.workspace }} + # Run the actual update - node scripts/update-n8n-deps.js + node scripts/update-n8n-deps.js || { + echo "❌ Error running update:" + exit 1 + } # Check if files changed if git diff --quiet; then @@ -84,8 +97,8 @@ jobs: git checkout -b $BRANCH_NAME git add package.json package-lock.json - # Get update summary - UPDATE_SUMMARY=$(cat update-summary.txt || echo "Updated n8n dependencies") + # Get update summary (file is written by the update script) + UPDATE_SUMMARY=$(cat update-summary.txt 2>/dev/null || echo "Updated n8n dependencies") # Commit changes git commit -m "chore: update n8n dependencies diff --git a/Dockerfile b/Dockerfile index 961c0bb..4afd076 100644 --- a/Dockerfile +++ b/Dockerfile @@ -34,7 +34,10 @@ RUN apk add --no-cache git ca-certificates && \ ENV N8N_DOCS_PATH=/tmp/n8n-docs # Build the complete database with source code RUN mkdir -p data && \ - node dist/scripts/rebuild-optimized.js + npm run rebuild:optimized || \ + (echo "Warning: Optimized rebuild failed, trying regular rebuild" && \ + npm run rebuild) || \ + (echo "Error: Database build failed" && exit 1) # Stage 4: Minimal Runtime (no n8n packages) FROM node:20-alpine AS runtime