fix: resolve GitHub Actions workflow failures
## Fixed dependency updater workflow - Added explicit workspace directory handling - Improved error handling with clear error messages - Fixed update summary file reading with error suppression - Added error output for debugging failures ## Fixed Docker build workflow - Added memory constraints (8GB/16GB swap) to prevent OOM - Fixed Dockerfile to use npm scripts instead of direct node execution - Added fallback mechanism: optimized rebuild → regular rebuild → error - Added buildx ID reference and no-cache filter for db-builder stage These changes should resolve both workflow failures and make the CI/CD pipeline more robust. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
8
.github/workflows/docker-build.yml
vendored
8
.github/workflows/docker-build.yml
vendored
@@ -32,7 +32,12 @@ jobs:
|
|||||||
uses: docker/setup-qemu-action@v3
|
uses: docker/setup-qemu-action@v3
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
|
id: buildx
|
||||||
uses: docker/setup-buildx-action@v3
|
uses: docker/setup-buildx-action@v3
|
||||||
|
with:
|
||||||
|
driver-opts: |
|
||||||
|
memory=8g
|
||||||
|
memory-swap=16g
|
||||||
|
|
||||||
- name: Log in to GitHub Container Registry
|
- name: Log in to GitHub Container Registry
|
||||||
if: github.event_name != 'pull_request'
|
if: github.event_name != 'pull_request'
|
||||||
@@ -69,6 +74,9 @@ jobs:
|
|||||||
build-args: |
|
build-args: |
|
||||||
BUILDKIT_INLINE_CACHE=1
|
BUILDKIT_INLINE_CACHE=1
|
||||||
provenance: false
|
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
|
# Nginx build commented out until Phase 2
|
||||||
# build-nginx:
|
# build-nginx:
|
||||||
|
|||||||
21
.github/workflows/update-n8n-deps.yml
vendored
21
.github/workflows/update-n8n-deps.yml
vendored
@@ -42,8 +42,15 @@ jobs:
|
|||||||
- name: Check for updates (dry run)
|
- name: Check for updates (dry run)
|
||||||
id: check
|
id: check
|
||||||
run: |
|
run: |
|
||||||
|
# Ensure we're in the right directory
|
||||||
|
cd ${{ github.workspace }}
|
||||||
|
|
||||||
# First do a dry run to check if updates are needed
|
# 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
|
# Check if updates are available
|
||||||
if grep -q "update available" update-check.log; then
|
if grep -q "update available" update-check.log; then
|
||||||
@@ -61,8 +68,14 @@ jobs:
|
|||||||
if: steps.check.outputs.updates_available == 'true'
|
if: steps.check.outputs.updates_available == 'true'
|
||||||
id: update
|
id: update
|
||||||
run: |
|
run: |
|
||||||
|
# Ensure we're in the right directory
|
||||||
|
cd ${{ github.workspace }}
|
||||||
|
|
||||||
# Run the actual update
|
# 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
|
# Check if files changed
|
||||||
if git diff --quiet; then
|
if git diff --quiet; then
|
||||||
@@ -84,8 +97,8 @@ jobs:
|
|||||||
git checkout -b $BRANCH_NAME
|
git checkout -b $BRANCH_NAME
|
||||||
git add package.json package-lock.json
|
git add package.json package-lock.json
|
||||||
|
|
||||||
# Get update summary
|
# Get update summary (file is written by the update script)
|
||||||
UPDATE_SUMMARY=$(cat update-summary.txt || echo "Updated n8n dependencies")
|
UPDATE_SUMMARY=$(cat update-summary.txt 2>/dev/null || echo "Updated n8n dependencies")
|
||||||
|
|
||||||
# Commit changes
|
# Commit changes
|
||||||
git commit -m "chore: update n8n dependencies
|
git commit -m "chore: update n8n dependencies
|
||||||
|
|||||||
@@ -34,7 +34,10 @@ RUN apk add --no-cache git ca-certificates && \
|
|||||||
ENV N8N_DOCS_PATH=/tmp/n8n-docs
|
ENV N8N_DOCS_PATH=/tmp/n8n-docs
|
||||||
# Build the complete database with source code
|
# Build the complete database with source code
|
||||||
RUN mkdir -p data && \
|
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)
|
# Stage 4: Minimal Runtime (no n8n packages)
|
||||||
FROM node:20-alpine AS runtime
|
FROM node:20-alpine AS runtime
|
||||||
|
|||||||
Reference in New Issue
Block a user