Powered by Jekyll & Minimal Mistakes (and some other nice tools :).
In order to reproduce this workflow it is necessary to have this software correctly installed:
- make
- git
- docker and docker-compose
- My benizar/jekyll image from Docker Hub.
This project has two git branches:
- The
source
branch contains the Jekyll project. - The
master
branch publishes the website (gh-pages).
This approach is very convenient for using Jekyll plugins and deploy the website only when necessary.
However, the target branch for GH-pages is reseted every time and it is necessary select it by hand.
Use Makefile as usual but, when you execute make
, it shows info about the most common tasks of my workflow:
make 1-new-draft
: Helps to create a new draft (and opens it in gedit).make 2-start-server
: Starts the jekyll server using dockers (and opens it in a web browser).make 3-stop-server
: Stops the docker and removes everything.make 4-push-source
: Pushes all edits to the source branch.make 5-deploy-website
: Pushes the updated .
Watch out! It is very IMPORTANT to git commit and git push your edits to the source branch before deploying your website (or you can do make 4-push-source
)
For deploying your website to GitHub you can do it by hand or using the deploy-website.sh script as follows:
bash deploy-website.sh
This script is going to:
- Make sure you're on the SOURCE branch
jekyll build
your site- Copy the _site to a temporary folder
- Delete the remote and local MASTER branch
- Create a new MASTER branch
- Copy the temporary folder contents to this branch (MASTER)
- Push your site to GitHub (MASTER)
- Switch back to the SOURCE branch
- Try to map users dynamically from Make and compose Docker compose as non root user
- Create a fast-git-undo script using get commit id and previous git state. Manage commited and not commited changes.