GitLab Pages is a powerful system for managing, editing and publishing static content web sites. Here’s a little insight into how it works.
First, Pages depends on GitLab CI to generate the HTML for the site when changes are made in the Git repo. The CI templates are public. This site uses the Hugo framework, so its CI configuration is based on the Hugo Pages template. Of course, the code there isn’t very interesting, for example:
pages: script: - hugo
hugo command comes from the Docker container which is pulled from DockerHub.
It’s easy to find the image on DockerHub using a search, and there’s a link to the repo where we find a Dockerfile that sets up the
hugo command. It’s easy to imagine that a prebaked Docker image would improve performance, although to be honest the current compile performance is pretty snappy.
GitLab Pages itself serves the sites from a web server that lives independently form the main GitLab Rails servers. It can handle domain names, HTTPS certificates, and authentication in GitLab itself. So while Pages is part of GitLab, it’s also separate in some ways.