diff options
| author | Franck Cuny <franckcuny@gmail.com> | 2016-07-02 21:00:27 -0700 |
|---|---|---|
| committer | Franck Cuny <franckcuny@gmail.com> | 2016-07-02 21:00:27 -0700 |
| commit | c9f9fc623afdf7b1038e457fce323f92c47eef5a (patch) | |
| tree | a683f1eea1051ca1f8354697b8e608c83c7dce16 /Makefile | |
| parent | Add build target to the Makefile. (diff) | |
| download | lumberjaph-c9f9fc623afdf7b1038e457fce323f92c47eef5a.tar.gz | |
Add target to deploy the site to gh-pages.
Build the site and commit it to the gh-pages branch, then push it.
Diffstat (limited to 'Makefile')
| -rw-r--r-- | Makefile | 24 |
1 files changed, 20 insertions, 4 deletions
@@ -1,18 +1,34 @@ +.PHONY: clean clean: hugo --cleanDestinationDir +.PHONY: server server: clean hugo serve --buildDrafts --buildFuture +.PHONY: deps deps: brew install hugo +.PHONY: build build: clean hugo +DEPLOY_BRANCH := gh-pages +DEPLOY_DIR := public + +.PHONY: publish publish: build - gsutil -m rsync -R _site/ gs://b.lumberjaph.net - gsutil -m acl ch -u AllUsers:R -R gs://b.lumberjaph.net/ - gsutil -m web set -m index.html -e 404.html gs://b.lumberjaph.net + git symbolic-ref HEAD refs/heads/$(DEPLOY_BRANCH) + git --work-tree $(DEPLOY_DIR) reset --mixed --quiet + git --work-tree $(DEPLOY_DIR) add --all + if git --work-tree $(DEPLOY_DIR) diff-index --quiet HEAD -- ; then \ + echo "no changes" ; \ + else \ + git --work-tree $(DEPLOY_DIR) commit -m "deploy " ; \ + git push origin $(DEPLOY_BRANCH) ; \ + fi -.PHONY: build clean server deps publish + git symbolic-ref HEAD refs/heads/master + git reset --mixed + rm rf $(DEPLOY_DIR) |
