Skip to content

Host using GitLab Pages

Tip

This course was updated in 2024. For the newer content, please visit Host using GitLab Pages

Video Lecture

Host using GitLab Pages Host using GitLab Pages

Description

You may prefer to use GitLab Pages to host your project instead of using GitHub Pages. The process is mostly similar but enabling the serving of your scripts through the GitLab pages web server requires the addition of a new file called gitlab-ci.yml.

We will use the GitLab user interface to create the gitlab-ci.yml.

  1. Log into your GitLab account and create a New Project/Repository. Then select the Create Blank Project option. Use any name for your project that you would like. GitLab will ignore any invalid characters for your projects final URL automatically as you type.

  2. Upload the required files from your ./dist/client/ folder. E.g., index.html, bundle,js and any other assets such as any images or 3D models needed by your project.

  3. If your assets, such as any 3D models or images should also be placed in a sub folder, then you can edit the file name using the GitLab user interface, prepend the required folder name and follow it with a / in front of the existing file name and then press the Commit Changes button. See video for example.

  4. Go back to the root of your project, and create a new file, and select gitlab-ci.yml, then Apply Template and then find and choose the HTML option. The HTML template is already correctly configured to serve static files, so you can press the Commit Changes button right away.

  5. Go to Settings/Pages and press the Save Changes button. You should then be presented with the URL of your projects GitLab page.

Visit : https://seanwasere.gitlab.io/my-project/

This is a very simple and minimal approach to hosting your Three.js examples for free as long as they can be fully downloaded as static files and don't require any bespoke or dynamic server side functionality or interaction.

GitLab Pages is acting just like a static HTTP web server but using a GitLab web address and an SSL certificate.

Comments