Build and deploy with make
This commit is contained in:
parent
b3b8be6e38
commit
3c5cc3e576
2 changed files with 54 additions and 11 deletions
29
Makefile
Normal file
29
Makefile
Normal file
|
@ -0,0 +1,29 @@
|
|||
# Includes
|
||||
-include include.mk
|
||||
|
||||
# deploy variables
|
||||
DEPLOY_BIN?=rsync
|
||||
DEPLOY_OPTS?=-avz --delete
|
||||
|
||||
BUILD_OPTS?=--gc --cleanDestinationDir
|
||||
BUILD_DEST?=public
|
||||
|
||||
.PHONY: serve
|
||||
serve:
|
||||
@hugo server -D --disableFastRender -v
|
||||
|
||||
.PHONY: build
|
||||
build:
|
||||
@hugo -d $(BUILD_DEST) $(BUILD_OPTIONS)
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
@[ -d $(BUILD_DEST) ] && rm -rf $(BUILD_DEST)
|
||||
|
||||
.PHONY: deploy
|
||||
deploy:
|
||||
|
||||
ifeq ($(DEPLOY_SERVER),)
|
||||
$(error DEPLOY_SERVER is not defined)
|
||||
endif
|
||||
[ -d $(BUILD_DEST) ] && $(DEPLOY_BIN) $(DEPLOY_OPTS) $(BUILD_DEST)/ $(DEPLOY_SERVER):$(DEPLOY_FOLDER)
|
Loading…
Add table
Add a link
Reference in a new issue