blog/Makefile
Bruno BELANYI ee916a506b
Some checks reported errors
continuous-integration/drone/push Build encountered an error
build: makefile: add deploy step
2021-08-08 16:23:51 +02:00

24 lines
496 B
Makefile

.PHONY: all
all: build-dev
.PHONY: build-dev
build-dev:
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 "$$KEY" ]; then eval "$$(ssh-agent)"; echo "$$KEY" | ssh-add -; fi
if [ -z "$$USERNAME" ] || [ -z "$$SSH_HOST" ] || [ -z "$$TARGET" ]; then exit 1; fi
rsync --progress -avz --delete public/ "$$USERNAME@$$SSH_HOST:$$TARGET"
.PHONY: clean
clean:
$(RM) -r public