ソースを参照

Automatically deploy website onto gh-pages

Kevin van Zonneveld 9 年 前
コミット
9b2eb3cf35
2 ファイル変更13 行追加9 行削除
  1. 9 1
      .travis.yml
  2. 4 8
      Makefile

+ 9 - 1
.travis.yml

@@ -7,8 +7,16 @@ script:
   - "npm run-script build"
   - "npm run-script build:examples"
 
+# Automatically deploy website onto gh-pages
 after_script:
-  - "echo 'Tested :)'"
+  - git config --global user.name 'Uppy Bot'
+  - git config --global user.email 'uppybot@uppyjs.io'
+  - make website-deploy ghpages_url=${GHPAGES_URL}
+
+env:
+  global:
+    # travis encrypt GHPAGES_URL=https://secret_access_token@github.com/transloadit/uppy.git
+    secure: "Z+Twmk8/yo4FbeHqk3TcLVK4fR+KUoevrUxkRM6SLckVeCwlFnoD1kQ4JTVHuS2LbW9r2T4VJ/SC6yDtdjqMRvD/ZtPw//vMw9mKyBEMZN4uxOhmHp4hltkBErqeHbZpgd4eSwSVrqDwliK27Q42wIs+Rjilc3UXqddWEmmw/VuxGR3SRpACILqe2Fqm/g73iX/7PNNASuXwmWi6Vf5ZeBQTGiCfPETblBa4WSCrPpsBv5flUEGNM9uFoXXqjAC2TyZrS4yiFGxJNf5/UPp9xipr+RhoEp8NX2GP0W2jDDfUTHFGfcUyF2lluVJKpkHjYQYrYBknjTFcQHL+aE7GWU7f6kh4g3i6e9qktVFV7yNPPokxuvVG+AxExVhZHK3wBTh2ZWs5vjcd0u5w+IV9+v+d/CZWl/zGRcHDILt2eUW9KZwoGtgrcaPnlVtYPCRBXPpsoD+lE3uOuGGGS/V5lmhBnCLexj+2rzztyb8zhQgZB2rLKF1zQ5JiBE+z0ykjHtZWMECE7r4H8K4hoaeOlIG9suPSgwQgl5HFniFUBzHWXqdsOA/tAwGAtdYSlSNAPrkiMYqXjb+1Je2uhYnfV2roBolufLmgYjmDkpVtaY968Zi3qSYTDX7gkx4NEdkiZDLJK8iXXF5RlcHHaUlno+4ytvcNMpf6V9EpTVeLaIs="
 
 deploy:
   acl              : public_read

+ 4 - 8
Makefile

@@ -1,11 +1,7 @@
 SHELL          := /usr/bin/env bash
 ghpages_repo   := "transloadit/uppy"
 ghpages_branch := "gh-pages"
-
-.PHONY: pull
-pull:
-	@echo "--> Running pull.."
-	@git pull
+ghpages_url    := "git@github.com:$(ghpages_repo).git"
 
 .PHONY: website-install
 website-install:
@@ -23,7 +19,7 @@ website-preview: website-install website-build
 	@cd website && ./node_modules/.bin/hexo server
 
 .PHONY: website-deploy
-website-deploy: pull website-build
+website-deploy: website-build
 	@echo "--> Deploying to GitHub pages.."
 	@mkdir -p /tmp/deploy-$(ghpages_repo)
 
@@ -46,8 +42,8 @@ website-deploy: pull website-build
 
 	@cd /tmp/deploy-$(ghpages_repo) \
 	  && git init && git checkout -B $(ghpages_branch) && git add --all . \
-	  && git commit -nm "Update $(ghpages_repo) _site by $${USER}" \
-	  && (git remote add origin git@github.com:$(ghpages_repo).git || true)  \
+	  && git commit -nm "Update $(ghpages_repo) website by $${USER}" \
+	  && (git remote add origin $(ghpages_url)|| true)  \
 	  && git push origin $(ghpages_branch):refs/heads/$(ghpages_branch) --force
 
 	@rm -rf /tmp/deploy-$(ghpages_repo)