This requires that the code be stored in a public Github repository (or "repo"), which it is (https://github.com/whroman/kite-lite).
Github listens for new commits on the branch gh-pages
. When new commit(s) are found, Github automagically pushes the new code to aqua-volta.com
. This is one form of a process called "continuous integration".
"Continuous integration" or "CI" is the software deployment process of having one's software system update another part of the system based on changes to a source control repository. Most modern software companies use some form of CI, including at mine and Cristina's current employers.
Another example of CI is my minesweeper project. The git repo's README has a button that says "coverage: 94%" (https://github.com/whroman/minesweeper-react). This tells me how much of the code has been touched by the code's test suite. I have a CI server set up (https://travis-ci.org/whroman/minesweeper-react) that listens to all branches of the minesweeper repo for new commits. When found, the server runs the test suite on the new code and pushes the "coverage" results to some other service, which overwrites the coverage button image seen on the README.
Put simply, most websites function like this:
- Browser asks Server for content, based on URL
- Server finds relevent data and injects it into its HTML templating engine.
- Server compiles templates into a single HTML page.
- Server sends the single HTML page and relevent assets (JS, CSS, images) back to Browser
This is not how aqua-volta.com
works. Steps 2 and 3 are not handled by the server because GHP only allows us to host "static" websites. To work around this, I am manually doing steps 2 and 3 when I work on my machine and then push the up the results in the GH repo. See "HTML Update Workflow".
This process is a bit convoluted, which I think will prevent Mike or Kim from being able to "just edit the HTML".
- I edit the content of
./templates/pages/about-us.ejs
. This is a "template" because it references other files, such as./templates/layout/start.ejs
. - I run
npm run build
on the command line. - A new
./about-us/index.html
is created, which is the compiled version ofabout-us.ejs
. - I commit the changes.
- I push the new commit to Github on branch
gh-pages
. - The changes are now reflected on
aqua-volta.com
.