Last active
July 30, 2017 03:12
-
-
Save thedavidmeister/b0a133774dce0f1645f76979659dcb66 to your computer and use it in GitHub Desktop.
Boot deploy to gh-pages
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(deftask gh-pages | |
"Build for production deployment." | |
[] | |
(comp | |
(hoplon) | |
(cljs :optimizations :advanced) | |
(target :dir #{"gh-pages"}))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://github.com/boot-clj/boot/wiki/Running-Boot-on-CI-systems | |
general: | |
artifacts: | |
- "/tmp" | |
machine: | |
java: | |
version: oraclejdk8 | |
environment: | |
BOOT_JVM_OPTIONS: -Xmx3g -client -XX:+TieredCompilation -XX:TieredStopAtLevel=1 -XX:+UseConcMarkSweepGC -XX:+CMSClassUnloadingEnabled -Xverify:none | |
pre: | |
- sudo sysctl fs.inotify.max_user_watches=524288 | |
dependencies: | |
pre: | |
- curl -L https://github.com/boot-clj/boot-bin/releases/download/2.5.2/boot.sh -o ~/bin/boot | |
- chmod +x ~/bin/boot | |
override: | |
# smoke test the gh-pages task before trying to deploy | |
- boot gh-pages | |
cache_directories: | |
- "~/bin" | |
- "~/.m2" | |
- "~/.boot/cache/bin" | |
- "~/.boot/cache/lib" | |
test: | |
override: | |
# Nothing to run here | |
- echo 1 | |
deployment: | |
# push snapshots of master through to github | |
github: | |
branch: master | |
commands: | |
- git config --global user.email "<YOUR_EMAIL_HERE>" | |
- git config --global user.name "Circle CI" | |
- . deploy.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
echo "checking out master..."; | |
git checkout master; | |
echo "fetching from git..."; | |
git fetch; | |
echo "building gh-pages directory..."; | |
boot gh-pages; | |
echo "committing gh-pages directory to git..." | |
git add .; | |
git commit -am "Deploy to github pages"; | |
echo "deploying to remote gh-pages branch..." | |
# git subtree push --prefix gh-pages origin gh-pages; | |
# https://stackoverflow.com/questions/13756055/git-subtree-subtree-up-to-date-but-cant-push/30715198#30715198 | |
git push origin `git subtree split --prefix gh-pages master`:gh-pages --force; | |
# Keep origin/master up to date as well | |
echo "pushing to master..." | |
git push; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment