Boyentenbi
Boyentenbi

Reputation: 417

How to deploy and sync a prototype Clojurescript app with Git?

I've been writing a Clojurescript app using figwheel. I intermittently push my code to a Git repository. I'd like people to be able to try the latest version I push, in their browser.

I've used AWS EC2 instances to host javascript apps before, but I had to manually cp my code every time I wanted to update them.

Is there a convenient way to deploy and sync a cljs browser app with Git?

Upvotes: 1

Views: 79

Answers (1)

Timothy Pratley
Timothy Pratley

Reputation: 10662

Github Pages is very convenient for hosting pages, as it serves things out of a branch gh-pages of your repo.

http(s)://username.github.io/projectname

I like to use a deploy.sh script:

#!/bin/bash
set -e
cd $(dirname $0)
lein do clean, cljsbuild once min
cd resources/public
git init
git add .
git commit -m "Deploy to GitHub Pages"
git push --force --quiet "[email protected]:timothypratley/pirates.git" master:gh-pages
rm -fr resources/public/.git

You can also nominate a directory: https://github.com/blog/2228-simpler-github-pages-publishing

Firebase and Heroku are good if you need more features.

Upvotes: 2

Related Questions