#!/bin/bash
set -euo pipefail
umask 022

ROOT="/volume2/webssd/fabiennefoehn"
LOG="$ROOT/deploy.log"
BRANCH="main"

cd "$ROOT" || exit 1

{
  echo "----- $(date) -----"
  whoami
  echo "PATH=$PATH"
  echo "Deploying branch: $BRANCH"
} >> "$LOG"

/usr/bin/git fetch origin >> "$LOG" 2>&1
/usr/bin/git reset --hard "origin/$BRANCH" >> "$LOG" 2>&1

echo "DONE" >> "$LOG"
