fix(ci): preserve support chat runtime configuration
Deploy Canina / deploy (push) Successful in 33s

This commit is contained in:
devops committed 2026-10-14 20:57:08 +00:00
1 parent 419e478489
commit 200ddda352
3 files changed
+17

No files matched your search

+3
View File
@@ -27,6 +27,9 @@ services:
NPM_REGISTRY: ${NPM_REGISTRY:-}
container_name: canino_backend_prod
restart: always
env_file:
- path: .support-chat.env
required: false
environment:
- NODE_ENV=production
- ENABLE_SWAGGER=false
+13
View File
@@ -66,6 +66,19 @@ fi
cd "$TARGET_DIR"
# Inject support-chat runtime configuration from CI/CD without committing secrets.
if [ "${SUPPORT_CHAT_KEY+x}" = x ]; then
touch .support-chat.env
grep -v '^SUPPORT_CHAT_KEY=' .support-chat.env > .support-chat.env.tmp || true
printf "SUPPORT_CHAT_KEY=%s\n" "$SUPPORT_CHAT_KEY" >> .support-chat.env.tmp
mv .support-chat.env.tmp .support-chat.env
chmod 600 .support-chat.env
fi
if [ ! -s .support-chat.env ]; then
echo "ERROR: missing .support-chat.env / SUPPORT_CHAT_KEY; refusing deployment" >&2
exit 1
fi
# ✅ فایل‌های کانفیگ را از پوشه‌ی scripts مخزن به TARGET_DIR کپی می‌کنیم
echo "Copying configuration files in $TARGET_DIR..."
cp "scripts/$COMPOSE_FILE" "docker-compose.yml"