30 lines
860 B
Makefile
30 lines
860 B
Makefile
.PHONY: all
|
|
all: build-dev
|
|
|
|
.PHONY: build-dev
|
|
build-dev:
|
|
HUGO_TITLE="Ambroisie's dev blog" HUGO_BASEURL=https://dev.belanyi.fr hugo -D -F
|
|
|
|
.PHONY: build-prod
|
|
build-prod:
|
|
HUGO_ENV=production hugo --minify
|
|
|
|
.PHONY: serve
|
|
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
|
|
export HOME="$$(mktemp -d)"
|
|
echo "$$HOME"
|
|
@echo rsync -e "env HOME=\"$$HOME\" ssh -o StrictHostKeyChecking=no" --progress -avz --delete public/ "$$SSH_USER@$$SSH_HOST:$$SSH_TARGET"
|
|
rsync -e "env HOME=\"$$HOME\" ssh -o StrictHostKeyChecking=no" --progress -avz --delete public/ "$$SSH_USER@$$SSH_HOST:$$SSH_TARGET"
|
|
|
|
.PHONY: clean
|
|
clean:
|
|
$(RM) -r public
|