GitLab Pages

We are going to use the GitLab CI runner to automatically publish the site (this CI runner is already included in your repository if you use

πŸ”— Repository setup

Your repository needs to be set up to be a user or group website. This means the name of the repository has to be in the correct format.

For example, under your username, john, you have to create a project called Your project URL will be Once you enable GitLab Pages for your project, your website will be published under

Under your group websites, you created a project called Your project’s URL will be Once you enable GitLab Pages for your project, your website will be published under

This guide assumes that your zola project is located in the root of your repository.

πŸ”— Ensuring that the CI runner can access your theme

Depending on how you added your theme your repository may not contain it. The best way to ensure the theme will be added is to use submodules. When doing this ensure you are using the https version of the URL.

$ git submodule add {THEME_URL} themes/{THEME_NAME}

For example, this could look like

$ git submodule add themes/hyde

πŸ”— Setting up the GitLab CI/CD Runner

The second step is to tell the gitlab continous integration runner how to create the gitlab page.

To do this, create a file called .gitlab-ci.yml in the root directory of your repository.

  # This variable will ensure that the CI runner pulls in your theme from the submodule
  # Specify the zola version you want to use here
  ZOLA_VERSION: "v0.9.0"

    # Download the zola executable and store it in zola.tar.gz
    - curl -L$ZOLA_VERSION/zola-$ZOLA_VERSION-x86_64-unknown-linux-gnu.tar.gz > zola.tar.gz
    # Unpack the zola executable
    - tar -xzf zola.tar.gz
    # Execute zola build
    - ./zola build
      # Path of our artifacts
      - public
  # This config will only publish changes that are pushed on the master branch
  - master

Push this new file and... Tada! You're done! If you navigate to settings > pages you should be able to see something like this:

Congratulations! Your pages are served under:

More information on the process to host on GitLab pages and additional information like using a custom domain is documented in this GitLab blog post.