Skip to content

Commit a654108

Browse files
committed
🐛 fix(ci): resolve npm ci sync issue in Docker build
Fix package-lock.json sync error by regenerating lock file before Docker build. This prevents the 'npm ci can only install packages when your package.json and package-lock.json are in sync' error that was causing deployment failures. - Add clean package-lock.json regeneration in Docker build step - Update server package-lock.json to be in sync with package.json - Remove problematic npm ci attempt before Docker build Fixes deployment failure on line 101 where Docker build failed with npm ci sync error.
1 parent 904e7e4 commit a654108

File tree

2 files changed

+5
-706
lines changed

2 files changed

+5
-706
lines changed

.github/workflows/ci-cd.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,9 @@ jobs:
218218
- name: 📦 Build Server Docker Image
219219
run: |
220220
cd server
221-
npm ci --include=optional || npm ci --omit=optional || (rm -rf node_modules package-lock.json && npm install --omit=optional)
221+
# Update package-lock.json to fix npm ci sync issues
222+
rm -f package-lock.json
223+
npm install --package-lock-only
222224
docker build -t lab1-todoapp-server:${{ needs.release.outputs.new-release-version }} --target production .
223225
docker save lab1-todoapp-server:${{ needs.release.outputs.new-release-version }} | gzip > lab1-todoapp-server.tar.gz
224226

0 commit comments

Comments
 (0)