From 4274671a23108a060369deaba0cb91ddcc7fdd53 Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Sun, 8 Aug 2021 16:23:51 +0200 Subject: [PATCH] build: makefile: add deploy step --- Makefile | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Makefile b/Makefile index 9ecbb22..bf1e0a3 100644 --- a/Makefile +++ b/Makefile @@ -13,6 +13,14 @@ build-prod: serve: hugo server -D -F +deploy: + @if [ -n "$$SSH_KEY" ]; then eval "$$(ssh-agent)"; echo "$$SSH_KEY" | ssh-add -; fi + @if [ -z "$$SSH_USER" ] || [ -z "$$SSH_HOST" ] || [ -z "$$SSH_TARGET" ]; \ + then echo "Missing one of SSH_USER, SSH_HOST, or SSH_TARGET" >&2; \ + exit 1; \ + fi + rsync --progress -avz --delete public/ "$$SSH_USER@$$SSH_HOST:$$SSH_TARGET" + .PHONY: clean clean: $(RM) -r public