How to publish to GitLab Pages using Renkulab
Problem: the GitLab instance behind Renkulab does not inherently have a GitLab Pages pushing functionality.
Solution: use conditional mirroring.
- create a renku project
- alter the .gitlab-ci.yml file slightly
- create an empty gitlab.com project
- set that gitlab.com project to pull from the renkulab project
Prototype repository: Create a plain renku project, such as Gavin Lee / my-pages · GitLab
The .gitlab-ci.yml file has been altered: see .gitlab-ci.yml · master · Gavin Lee / my-pages · GitLab
In particular, there are two stages, ‘build’ and ‘deploy’, with variables which are tagged as exceptions. The $CI_PROJECT_URL specifies the gitlab.com project to push updates to.
The ‘pages:’ section is taken directly from the GitLab Pages examples / plain-html · GitLab example.
Prototype repository: gavin-k-lee / my-book · GitLab. When first setting this up, you should create an EMPTY repository. I have named the renkulab project ‘my-pages’ and the gitlab.com project ‘my-book’ to distinguish the two. You can name them the same thing, but this is slightly confusing sometimes because the renku gitlab and native gitlab instances have the same user interfact in the browser!
Set up mirroring in gitlab.com as shown. For the password, you need to set up a personal access token in renkulab with at least ‘read_repository’ permissions. Be sure to copy that token into your clipboard as it does not get shown after leaving that page.
The mirroring should begin to pull the renkulab contents into the empty repository.
You should then view the GitLab Pages result!