Makefile 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. SHELL := /usr/bin/env bash
  2. ghpages_repo := "transloadit/uppy"
  3. ghpages_branch := "gh-pages"
  4. ghpages_url := "git@github.com:$(ghpages_repo).git"
  5. .PHONY: website-install
  6. website-install:
  7. @echo "--> Installing dependencies.."
  8. @cd website && npm install
  9. .PHONY: website-build
  10. website-build: website-install
  11. @echo "--> Building site.."
  12. @npm run build:umd
  13. @cd website && node update.js
  14. @cd website && ./node_modules/.bin/hexo generate
  15. .PHONY: website-preview
  16. website-preview: website-build
  17. @echo "--> Running preview.."
  18. @cd website && ./node_modules/.bin/hexo server
  19. .PHONY: website-deploy
  20. website-deploy: website-build
  21. @echo "--> Deploying to GitHub pages.."
  22. @mkdir -p /tmp/deploy-$(ghpages_repo)
  23. # Custom steps
  24. @rsync \
  25. --archive \
  26. --delete \
  27. --exclude=.git* \
  28. --exclude=node_modules \
  29. --exclude=lib \
  30. --itemize-changes \
  31. --checksum \
  32. --no-times \
  33. --no-group \
  34. --no-motd \
  35. --no-owner \
  36. ./website/public/ /tmp/deploy-$(ghpages_repo)
  37. @echo 'This branch is just a deploy target. Do not edit. You changes will be lost.' > /tmp/deploy-$(ghpages_repo)/README.md
  38. @cd /tmp/deploy-$(ghpages_repo) \
  39. && git init && git checkout -B $(ghpages_branch) && git add --all . \
  40. && git commit -nm "Update $(ghpages_repo) website by $${USER}" \
  41. && (git remote add origin $(ghpages_url)|| true) \
  42. && git push origin $(ghpages_branch):refs/heads/$(ghpages_branch) --force
  43. @rm -rf /tmp/deploy-$(ghpages_repo)