web-deploy 969 B

1234567891011121314151617181920212223242526272829303132
  1. #!/bin/bash
  2. ghpages_repo=${GHPAGES_REPO:-"transloadit/uppy"}
  3. ghpages_branch=${GHPAGES_BRANCH:-"gh-pages"}
  4. ghpages_url=${GHPAGES_URL:-"git@github.com:${ghpages_repo}.git"}
  5. echo "--> Deploying to GitHub pages.."
  6. mkdir -p /tmp/deploy-${ghpages_repo}
  7. # Custom steps
  8. rsync \
  9. --archive \
  10. --delete \
  11. --exclude=.git* \
  12. --exclude=node_modules \
  13. --exclude=lib \
  14. --itemize-changes \
  15. --checksum \
  16. --no-times \
  17. --no-group \
  18. --no-motd \
  19. --no-owner \
  20. ./website/public/ /tmp/deploy-${ghpages_repo}
  21. echo 'This branch is just a deploy target. Do not edit. You changes will be lost.' > /tmp/deploy-${ghpages_repo}/README.md
  22. cd /tmp/deploy-${ghpages_repo} \
  23. && git init && git checkout -B ${ghpages_branch} && git add --all . \
  24. && git commit -nm "Update ${ghpages_repo} website by $${USER}" \
  25. && (git remote add origin ${ghpages_url}|| true) \
  26. && git push origin ${ghpages_branch}:refs/heads/${ghpages_branch} --force
  27. rm -rf /tmp/deploy-${ghpages_repo}