2020-07-14 17:00:41 +02:00
|
|
|
.PHONY: all
|
2021-08-08 16:01:27 +02:00
|
|
|
all: build-dev
|
2020-07-14 17:00:41 +02:00
|
|
|
|
|
|
|
.PHONY: build-dev
|
|
|
|
build-dev:
|
2021-08-08 16:37:32 +02:00
|
|
|
HUGO_TITLE="Ambroisie's dev blog" HUGO_BASEURL=https://dev.belanyi.fr hugo -D -F
|
2020-07-14 17:00:41 +02:00
|
|
|
|
|
|
|
.PHONY: build-prod
|
|
|
|
build-prod:
|
2021-08-08 16:01:27 +02:00
|
|
|
HUGO_ENV=production hugo --minify
|
2020-07-14 17:00:41 +02:00
|
|
|
|
|
|
|
.PHONY: serve
|
2021-08-08 16:01:27 +02:00
|
|
|
serve:
|
2020-07-15 16:59:11 +02:00
|
|
|
hugo server -D -F
|
2020-07-14 17:00:41 +02:00
|
|
|
|
2021-08-08 16:23:51 +02:00
|
|
|
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
|
2021-08-08 17:23:09 +02:00
|
|
|
export HOME="$$(mktemp -d)"
|
2021-08-08 17:33:54 +02:00
|
|
|
rsync -e "env HOME=\"$$HOME\" ssh -o StrictHostKeyChecking=no" --progress -avz --delete public/ "$$SSH_USER@$$SSH_HOST:$$SSH_TARGET"
|
2021-08-08 16:23:51 +02:00
|
|
|
|
2020-07-14 17:00:41 +02:00
|
|
|
.PHONY: clean
|
|
|
|
clean:
|
|
|
|
$(RM) -r public
|