fix: restore shared production env during deploy

This commit is contained in:
cesnimda
2026-03-22 21:24:05 +01:00
parent 9914de19f4
commit 8014c1e890
2 changed files with 27 additions and 4 deletions
+13 -2
View File
@@ -3,8 +3,19 @@ set -euo pipefail
cd "$(dirname "$0")/.."
if [ ! -f .env ]; then
echo "Missing .env in deployment directory"
ENV_SOURCE="/opt/job-tracker/shared/.env"
ENV_TARGET=".env"
if [ ! -f "$ENV_SOURCE" ]; then
echo "Missing shared env file at $ENV_SOURCE"
exit 1
fi
# Keep runtime secrets outside the repo checkout so workflow uploads cannot wipe them.
ln -sf "$ENV_SOURCE" "$ENV_TARGET"
if [ ! -f "$ENV_TARGET" ]; then
echo "Failed to link deployment env file into $(pwd)/$ENV_TARGET"
exit 1
fi