Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

For every commit, create an equivalent compiled commit in a separate repo or branch

I'm building sites using Jekyll, which compiles ERB, SASS, &c. into plain HTML & CSS.

After most commits, I'd like to compile the site and commit the compiled version in a separate repository or branch so that it can be pushed to a static server.

What is the best way to go about this?

I already have a solution, but I was hoping someone might have a more elegant one.

like image 400
Zaz Avatar asked Feb 04 '17 21:02

Zaz


1 Answers

After most commits, I'd like to compile the site and commit the compiled version in a separate repository or branch so that it can be pushed to a static server.

The right Keyword for you is "Continuous Integration".

You can use a CI Software like Jenkins to build your system after every commit, after creating or modifying a pull request, or just nightly.

The Build Script which you configure in the CI Software is than responsible to deploy the build artefacts, in that case your compiled version, to your target system like an s3 bucket. You can also do a programmatic commit of your artefacts to a different git repo.

Have a look here: https://jenkins.io/doc/

like image 161
blndev Avatar answered Oct 11 '22 16:10

blndev