feat(deploy): add envsubst-based deployment script

This commit is contained in:
deytenit committed 2026-01-25 21:01:13 +03:00
1 parent c143518119
commit a6cbc6aa61
1 file changed
+30
+30
View File
@@ -0,0 +1,30 @@
#!/bin/bash
set -e
# Get the directory where the script is located
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
DEPLOY_DIR="$(cd "$SCRIPT_DIR/../deploy" && pwd)"
echo "Starting deployment for com-ermnvldmr..."
# Export current tags if they exist in .env to ensure continuity for services NOT being updated
if [ -f "$DEPLOY_DIR/.env" ]; then
export $(grep -v '^#' "$DEPLOY_DIR/.env" | xargs)
fi
# Override with new tags provided via env (passed from GitHub)
# The variables DOCS_TAG and WWW_TAG should already be in the environment
# Generate new .env from template
echo "Generating .env from template..."
envsubst < "$DEPLOY_DIR/.env.template" > "$DEPLOY_DIR/.env"
# Run Docker Compose
cd "$DEPLOY_DIR"
echo "Pulling images..."
docker compose pull
echo "Starting containers..."
docker compose up -d --remove-orphans
echo "Deployment complete."