diff --git a/.travis.yml b/.travis.yml index 48f7914f8..90d95fb6a 100644 --- a/.travis.yml +++ b/.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 diff --git a/Makefile b/Makefile index a88bab069..59347bea1 100644 --- a/Makefile +++ b/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)