Enhance Makefile and Netlify deployment (#91)

This commit is contained in:
Khosrow Moossavi 2018-10-04 12:06:06 -04:00 committed by Luiz F. A. de Prá
parent 9118a00aeb
commit dcefc200ee
4 changed files with 20 additions and 10 deletions

View File

@ -1,17 +1,18 @@
.PHONY: release build demo clean .PHONY: prepare release build demo clean
build: clean build: prepare
./hugow --source demo
demo: prepare
./hugow server --buildDrafts --source demo
release: build
rm -rf ./resources && cp -r ./demo/resources ./resources
prepare: clean
mkdir -p demo/themes/hugo-coder mkdir -p demo/themes/hugo-coder
rsync -av exampleSite/ demo rsync -av exampleSite/ demo
rsync -av --exclude='demo' --exclude='exampleSite' --exclude='.git' . demo/themes/hugo-coder rsync -av --exclude='demo' --exclude='exampleSite' --exclude='.git' . demo/themes/hugo-coder
demo: build
cd demo && ./hugow serve -D
release: build
cd ./demo && ./hugow
rm -rf ./resources && cp -r ./demo/resources ./resources
clean: clean:
rm -rf demo rm -rf demo

9
netlify.toml Normal file
View File

@ -0,0 +1,9 @@
[build]
publish = "demo/public"
command = "make prepare && hugo --source demo"
[context.deploy-preview]
command = "make prepare && hugo --source demo --buildFuture --buildDrafts --baseURL $DEPLOY_PRIME_URL"
[context.deploy-preview.environment]
HUGO_VERSION = "0.49"