GitLab offers a way to create and host web pages called GitLab Pages. The following article describes how to create a GitLab Pages project.
After creating, you can access your website via https://<user>.pages.enterpriselab.ch/<project>/. Your link looks something like this: https://iauser.pages.enterpriselab.ch/myproject
The official documentation can be found here: https://docs.gitlab.com/ee/user/project/pages/
It is assumed that the reader has an active Enterprise Lab account and is somewhat familiar with GitLab and Bash.
Server-side languages like PHP or nodeJS will not work with GitLab Pages.
This is the way to go when you are starting from scratch or if you already have a web page running under user.enterpriselab.ch and would like to migrate.
The easiest way is to create a new project under New project.
Then click on the Create from template tab and select Pages/Plain HTML. button
Finally, click on Use template and give the project a name.
More information about each template can be found with the button Preview.
If you're migrating from user.enterpriselab.ch, simply remove the contents of the public directory and replace them with the files from your public_html directory.
An elegant way to do this would be the following:
git clone https://gitlab.enterpriselab.ch/username/your-project.git
cp ~/public_html/* ~/your-project/public/
git commit -a -m "migrated contents from user.enterpriselab.ch"
If you already have an existing GitLab project and want to start using Pages with it, follow these instructions.
Should your project already contain a .gitlab-ci.yml it is necessary to merge the two. Read up on the documentation if you are unsure of how to do this.
1. Add the file .gitlab-ci.yml in the project root directory. This yml content comes from pages/Plain HTML project.
More about .gitlab-ci.yml can be found here: https://docs.gitlab.com/ee/ci/yaml/
image: alpine:latest pages: stage: deploy script: - echo 'Nothing to do...' artifacts: paths: - public/ only: - master
2. Add your index.html file in the subdirectory public.
For an example html file see below.