add staging build to makefile

Signed-off-by: Toshaan Bharvani <toshaan@vantosh.com>
remotes/1691128968110617338/master
Toshaan Bharvani 2 years ago
parent 40eee5d7e2
commit 1d1ed69308

@ -1,6 +1,8 @@
#!Makefile #!Makefile


HUGO=hugo-extended HUGO=hugo-extended
BUILDNAME:=$(shell git rev-parse --abbrev-ref HEAD)
BASEURL:=$(shell basename `pwd` | sed 's/_/./g')


default all: build default all: build


@ -11,6 +13,10 @@ build:
@find public/ -name '*.css' ! -name '*.gz' -type f -exec sh -c "gzip -c -9 < {} > {}.gz" \; @find public/ -name '*.css' ! -name '*.gz' -type f -exec sh -c "gzip -c -9 < {} > {}.gz" \;
@find public/ -name '*.js' ! -name '*.gz' -type f -exec sh -c "gzip -c -9 < {} > {}.gz" \; @find public/ -name '*.js' ! -name '*.gz' -type f -exec sh -c "gzip -c -9 < {} > {}.gz" \;


.PHONY: build-staging
build-staging:
$(HUGO) --environment=production --minify --templateMetrics --baseURL https://$(BASEURL)/$(BUILDNAME)/ --destination builds/$(BUILDNAME)

.PHONY: test .PHONY: test
test: clean test: clean
$(HUGO) --environment=development --minify $(HUGO) --environment=development --minify
@ -34,4 +40,6 @@ servedraft:
.PHONY: clean .PHONY: clean
clean: clean:
@rm -rf public/ @rm -rf public/
@rm -rf builds/
@rm -rf resources/ @rm -rf resources/


Loading…
Cancel
Save