sync-gh-pages.sh 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #!/bin/bash -eu
  2. # This script builds a new gh-pages branch from latest master
  3. cd "$(dirname $0)/.."
  4. git fetch origin
  5. git checkout -B gh-pages origin/master
  6. git reset --hard origin/master
  7. git clean -dffx
  8. # Run npm-install to fetch qunitjs and build dist/
  9. npm install
  10. html='<!DOCTYPE html>
  11. <meta charset="utf-8">
  12. <title>VisualEditor</title>
  13. <link rel=stylesheet href="lib/oojs-ui/oojs-ui-apex.css">
  14. <link rel=stylesheet href="demos/ve/demo.css">
  15. <style>
  16. article {
  17. margin: 1em auto;
  18. width: 45em;
  19. max-width: 80%;
  20. text-align: center;
  21. }
  22. article img {
  23. max-width: 100%;
  24. }
  25. </style>
  26. <article>
  27. <img src="demos/ve/VisualEditor-logo.svg" alt="VisualEditor logo">
  28. <div class="oo-ui-widget oo-ui-widget-enabled oo-ui-buttonElement oo-ui-buttonElement-framed oo-ui-labelElement oo-ui-buttonWidget"><a role="button" href="demos/ve/desktop-dist.html" tabindex="0" class="oo-ui-buttonElement-button"><span class="oo-ui-labelElement-label">Demo</span></a></div></a>
  29. <div class="oo-ui-widget oo-ui-widget-enabled oo-ui-buttonElement oo-ui-buttonElement-framed oo-ui-labelElement oo-ui-buttonWidget"><a role="button" href="tests/" tabindex="0" class="oo-ui-buttonElement-button"><span class="oo-ui-labelElement-label">Test suite</span></a></div>
  30. </article>'
  31. echo "$html" > index.html
  32. git add index.html
  33. git add -f node_modules/qunitjs dist/
  34. git commit -m "Create gh-pages branch"
  35. git push origin -f HEAD