Gitlab normally displays the source of HTML files you access through your web browser.
Here is how to force Gitlab to interpret and display the render of these files.
- It works on any Gitlab instance ( Gitlab.com or Frama.io for example)
- Upload your files to your Gitlab repository
- At the root of this repo, add a file called
.gitlab-ci.ymlcontaining the following lines:
pages: script: - mkdir .public - cp -r * .public - mv .public public artifacts: paths: - public
Your file is now available at
Check your settings
Important note: Your repository must be public (in Settings → Visibility) if you want to allow unregistered users to access your file.
You can also use this technique with a private repository, see this post for details: Gitlab: use public Pages while keeping the Git repo private.
- How to host an html page in GitLab Pages
- Websites for your GitLab projects, user account or group
- GitLab Pages | GitLab
- Comment utiliser les Gitlab Pages ? (in french)
- Get a shorter URL with
this solution based on
- Another implementation : https://gitlab.com/pages/plain-html