Update deploy scripts to work with Vite dist dir (vs. build dir)

This commit is contained in:
2026-01-08 16:57:18 +00:00
parent 3ebd7ea251
commit bd5bb647b2
3 changed files with 40 additions and 3 deletions

28
scripts/deploy.sh Executable file
View File

@@ -0,0 +1,28 @@
#!/usr/bin/env bash
set -euo pipefail
# remoteUser="username"
remoteHost="11001001.org"
# remotePort=22
remoteDir="/var/www/med-plan-assistant"
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
localDist="${SCRIPT_DIR}/../dist"
if [[ ! -d "${localDist}" ]]; then
echo "Dist folder not found: ${localDist}" >&2
exit 1
fi
dest="${remoteHost}:${remoteDir}"
if [[ -n "${remoteUser:-}" ]]; then
dest="${remoteUser}@${remoteHost}:${remoteDir}"
fi
scp_args=()
if [[ -n "${remotePort:-}" ]]; then
scp_args+=("-P" "${remotePort}")
fi
# Copy contents of dist directory to remote target
scp -r "${scp_args[@]}" "${localDist}/"* "${dest}"