16. GitLab basics

GitLab (like GitHub) provides git based repo hosting and DevOps service (app build, test, run on cloud). They have very good free services which I use.

16.1 GitLab Pages

We can host a static website using GitLab Pages
Reference: https://gitlab.com/pages/plain-html
In fact, this website is hosted on such service.

create an empty project or repo create the following file in the top dir

file: .gitlab-ci.yml
pages:
  stage: deploy
  script:
    - echo 'nothing ...'
  artifacts:
    paths:
      - public
  only:
    #- master
    - test

GitLab expects a directory called 'public' to be present in the main directory of the repo.
It serves all the static files from this directory. Hence, we need to keep index.html in this directory.
If we are going to generate files from static site generator,
then just keep the generated files into the public directory.
Note, public directory needs to be root dir for the static site.