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.
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/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With