I need to host a static website with gitlab pages. My repo is a private repository (or project) and the .gitlab-ci.yml
that I tried to use looks like this:
image: gpecchio:BeCall
pages:
stage: deploy
script:
- echo 'Nothing to do...'
artifacts:
paths:
- private
only:
- master
I believe that the image
is wrong but I have no idea about what to change it to. I did some research but there aren't that many tutorials online for GitLab pages. How could I change this file to make it work?
Other info that might be useful:
GitLab username: gpecchio
GitLab project name: BeCall
GitLab project url: https://gitlab.com/gpecchio/BeCall
With GitLab Pages you can host your static website for free.
With GitLab Pages, you can publish static websites directly from a repository in GitLab. Use for any personal or business website.
Is your website created in html or are you using a static generator to create your website and then using gitlab pages to host it?
In the .gitlab-ci.yml file, the artifacts need to be public (even if your repository is private) for hosting your website using gitlab pages.
Here are some examples of what your .gitlab-ci.yml file needs to look like for hosting your site with gitlab pages.
HTML
pages:
stage: deploy
script:
- mkdir .public
- cp -r * .public
- mv .public public
artifacts:
paths:
- public
only:
- master
Jekyll
image: ruby:2.3
pages:
stage: deploy
script:
- gem install jekyll
- jekyll build -d public/
artifacts:
paths:
- public
only:
- master
Hexo
image: node:4.2.2
pages:
cache:
paths:
- node_modules/
script:
- npm install hexo-cli -g
- npm install
- hexo deploy
artifacts:
paths:
- public
only:
- master
You should check out https://gitlab.com/pages/ which has examples of static sites created using all the different static site generator and hosted using gitlab pages.
You can also find some Jekyll themes hosted on gitlab pages at https://gitlab.com/groups/jekyll-themes
Finally, the link to your gitlab project url: https://gitlab.com/gpecchio/BeCall is private.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With