-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathMakefile
More file actions
37 lines (30 loc) · 891 Bytes
/
Makefile
File metadata and controls
37 lines (30 loc) · 891 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
GEN_TARGET_DIR=_site
SITE_GIT_DIR=$(GEN_TARGET_DIR).git
CNAME=CNAME
REMOTE=github.com/functional-vilnius/functional-vilnius.github.io
.PHONY: build commit upload
build:
cabal run rebuild
$(GEN_TARGET_DIR): build
## Used by TravisCI
$(SITE_GIT_DIR):
git fetch origin master:master
git clone \
--single-branch \
-b master \
. \
$@
commit: | $(SITE_GIT_DIR) $(GEN_TARGET_DIR) $(CNAME)
cp -r $(GEN_TARGET_DIR)/* $(SITE_GIT_DIR)
cp $(CNAME) $(SITE_GIT_DIR)
cd $(SITE_GIT_DIR) && \
git add -A && \
git diff --cached --quiet --exit-code || ( \
git commit \
-m "Build $$(TZ='Europe/Vilnius' date --rfc-3339=seconds)" && \
git push ../ master:master) # avoid diverging
upload: | $(SITE_GIT_DIR)
@test ${GH_TOKEN} || (echo "Error: Github Token missing!" && exit 1)
test ${REMOTE}
cd $(SITE_GIT_DIR) && \
git push "https://${GH_TOKEN}@${REMOTE}" master:master