Skip to content

Create .gitlab-ci.yml for static site generation

This repository is provided on https://deeplearningindaba.com/grand-challenges/leishmaniasis/resources/ as a resource but this repository is somewhat needlessly opaque at first glance. Looking at the examples in this repository mandates downloading the files to view what is essentially a static website. Gitlab provides tools for static website creation and will host it for you for free. Adding a .gitlab-ci.yml file will enable gitlab to create a static website and serve it. This is useful for not only for casual browsing but particularly those on smartphones who are just getting a glance of this project.

On your part all you have to do is add this file as .gitlab-ci.yml to the repository (and perhaps link to the website in your description):

image: alpine:latest

pages:
  stage: deploy
  script:
  - echo '[1/3] Generating public folder'
  - mkdir public
  - echo '[2/3] Copying assets to public folder'
  - ls -A | grep -Ev "public|.git" | while read file; do cp -r "$file" public; done
  - echo '[3/3] Cast to index.html'
  - mv public/*.html public/index.html
  artifacts:
    paths:
    - public
  only:
  - master

On commit, gitlab will run a pipeline and automatically generate a static site for you.

Example repository: https://gitlab.com/manjalyc/grandchallenge-static

Example Site: https://manjalyc.gitlab.io/grandchallenge-static/

For more information please look up gitlab pages.

Edited by Cyriac Manjaly