Shaky start, moving to GitLab
A couple of days ago I figured out how to get a Jekyll site up and running locally and pushed it to Github only to discover that my first post didn’t show up. After some research I found out that jekyll-paginate-v2 was not supported by Github, even though the author stated it was backwards compatible. Now that I’m thinking about it, I realize that the gems behavior is backwards compatible and not necessarily Github compatible.
To get the site working two options came to mind. Either convert my site to use the Github supported gem or move to a host that supports jekyll-paginate-v2. As it turns out, GitLab did fit the requirement and I found a guide (Moving your Jekyll site from GitHub Pages to GitLab) explaining the steps involved to migrate the Github repository to a GitLab project.
Basically create a GitLab project and copy the site content over. Add gems to the Gemfile and create a .gitlab-ci.yml file for CI/CD. I had to delete the Gemfile.lock before the build worked on GitLab. I also removed the CNAME file that Github uses for the custom domain.
This is the .gitlab-ci.yml I ended up using:
# requiring the environment of Ruby 2.3.x
image: ruby:2.3
# add bundle cache to 'vendor' for speeding up builds
cache:
paths:
- vendor/
before_script:
- bundle install --path vendor
# the 'pages' job will deploy and build your site to the 'public' path
pages:
stage: deploy
script:
- bundle exec jekyll build -d public/
variables:
JEKYLL_ENV: production
LANG: "C.UTF-8"
artifacts:
paths:
- public
only:
- master # this job will affect only the 'master' branch