-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
43 lines (36 loc) · 1.09 KB
/
Makefile
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
branch = $(shell git symbolic-ref --short -q HEAD)
commit = $(shell git rev-parse -q HEAD)
ifneq ($(strip $(branch)),)
isbranch = yes
else
isbranch = no
endif
gh-pages:
@npm run build
@npm run doc
# create a temporary branch and commit any changes
@git checkout -b temp-$(commit)
-git add .
-git commit -a -m "make"
# update gh-pages with the new build, examples, and docs
@git checkout gh-pages
@git checkout temp-$(commit) -- build
@git checkout temp-$(commit) -- examples
@git checkout temp-$(commit) -- doc
# copy the doc folder to the index and cleanup
@cp -R doc/. .
@rm -rf doc
# create a new gh-pages branch and commit these changes
# this should be easy to arc diff or merge into gh-pages
@git checkout -b gh-pages-$(commit)
-git add .
-git commit -a -q -m "make gh-pages from $(commit)"
# soft reset the changes from temp, and delete the temp branch
@git checkout temp-$(commit)
@git reset --soft $(commit)
ifeq ($(isbranch), yes) # we make a branch check here to avoid detaching the HEAD
@git checkout $(branch)
else
@git checkout $(commit)
endif
@git branch -D temp-$(commit)