blog/Makefile

27 lines
585 B
Makefile
Raw Normal View History

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:01:27 +02:00
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:
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
rsync --progress -avz --delete public/ "$$SSH_USER@$$SSH_HOST:$$SSH_TARGET"
2020-07-14 17:00:41 +02:00
.PHONY: clean
clean:
$(RM) -r public