- Read NEXT_PUBLIC_COLLAB_SERVER_URL in yjs provider; bake NEXT_PUBLIC_* at Docker build - Add prod compose, deploy scripts, CT 116 proxmox scaffolding - Forgejo Actions CI/deploy; migrate-origin and post-migration scripts
20 lines
630 B
Bash
Executable file
20 lines
630 B
Bash
Executable file
#!/usr/bin/env bash
|
|
# Sync production checkout to the deploy branch tip (used by deploy webhook + CI over SSH).
|
|
set -euo pipefail
|
|
|
|
repo_root="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
|
cd "$repo_root"
|
|
|
|
branch="${DEPLOY_BRANCH:-main}"
|
|
remote="${DEPLOY_GIT_REMOTE:-origin}"
|
|
|
|
if [[ ! -d .git ]]; then
|
|
echo "[git-sync-deploy] ERROR: ${repo_root} is not a git repository" >&2
|
|
exit 1
|
|
fi
|
|
|
|
echo "[git-sync-deploy] fetching ${remote}/${branch}..."
|
|
git fetch "$remote" "$branch"
|
|
git checkout "$branch"
|
|
git reset --hard "${remote}/${branch}"
|
|
echo "[git-sync-deploy] at $(git rev-parse --short HEAD) ($(git log -1 --format='%s'))"
|