#!/usr/bin/env bash
set -euo pipefail
while read -r old new ref; do
    if [ "$ref" = refs/heads/main ]; then
        /home6/kdhccoke/bin/deploy-kdhc "$new" || {
            echo 'DEPLOYMENT FAILED. Push was received; inspect the server before retrying.' >&2
            exit 1
        }
    fi
done
