fix: prevent duplicate network creation in deploy-dev
Run Tests / Backend Tests (push) Waiting to run
Deploy Dashboard (Dev) / deploy-dev (push) Failing after 16m40s
Run Tests / Frontend Tests (push) Has started running
Run Tests / Test Summary (push) Has been cancelled

Use docker network inspect to check if network exists before creating.
This commit is contained in:
Gan, Jimmy
2026-04-06 18:52:40 +08:00
parent c474cd8de2
commit dc6aefd0ab
+5 -3
View File
@@ -66,11 +66,13 @@ jobs:
# Clean up any legacy manual containers # Clean up any legacy manual containers
docker rm -f nas-dashboard-dev 2>/dev/null || true docker rm -f nas-dashboard-dev 2>/dev/null || true
# Ensure network exists # Ensure network exists (create only if it doesn't exist)
docker network create nas-dashboard_internal 2>/dev/null || true if ! docker network inspect nas-dashboard_internal >/dev/null 2>&1; then
docker network create nas-dashboard_internal
fi
# Use a dedicated project name to avoid killing production (which is project 'nas-dashboard') # Use a dedicated project name to avoid killing production (which is project 'nas-dashboard')
# and deploy using theSynced compose file. # and deploy using the synced compose file.
docker compose -f docker-compose.dev.yml -p nas-dashboard-dev down --remove-orphans || true docker compose -f docker-compose.dev.yml -p nas-dashboard-dev down --remove-orphans || true
docker compose -f docker-compose.dev.yml -p nas-dashboard-dev up -d --build --pull never docker compose -f docker-compose.dev.yml -p nas-dashboard-dev up -d --build --pull never