-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
44 lines (34 loc) · 978 Bytes
/
Makefile
File metadata and controls
44 lines (34 loc) · 978 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
GIT=git@github.com:kppoint/kppoint.github.io.git
DEPLOY_BRANCH=master
.PHONY: build push clean deploy
# Build production html using gulp and put the site in /build directory
#
build: clean
NODE_ENV=production gulp build
mkdir build
cp index.html build/index.html
cp index.html build/404.html
cp favicon.ico build/favicon.ico
# cp config/CNAME build/CNAME
cp -R assets build/
cp -R static build/
cp -R vendor build/
# Intialize git and push the content to master.
# Note: It is supposed to be executed in build directory
#
push-in-build:
git init
git remote add origin $(GIT)
git checkout --orphan $(DEPLOY_BRANCH)
git add .
git commit -m "Compiled from $(MSG)"
git push --force origin $(DEPLOY_BRANCH)
# Commits all files in build/ directory to repository's master branch
#
push: build
cp Makefile build/
MSG="$(shell git log -n 1 --pretty=format:'%h - %s')" $(MAKE) push-in-build -C build
clean:
rm -rf assets
rm -rf build
deploy: clean build push