GitLab Pipelines

Description

GitLab Pages is a free hosting service integrated directly with GitLab. You can have your Plenti websites automatically deploy to GitLab Pages by adding a .gitlab-ci.yml file to your project to automatically build and deploy your website every time you push to your master branch on GitLab.

Unfortunately GitLab has a bug that is preventing us from using the official Docker image for the project like you'd expect: 

image:
  name: plentico/plenti:latest
  entrypoint: [""]

pages:
  script:
    - /plenti build
  artifacts:
    paths:
      - public
  only:
    - master

So for now we have a temporary workaround you can use:

image: docker:stable

pages:
  before_script:
    - apk add --update curl wget && rm -rf /var/cache/apk/*
  script:
    - wget -c $(curl -s https://api.github.com/repos/plentico/plenti/releases/latest | grep -o 'http.*linux_64-bit.tar.gz')
    - tar -zxvf *_linux_64-bit.tar.gz
    - ./plenti build
  artifacts:
    paths:
      - public
  only:
    - master

It is a good idea to lock your CI to a specific Plenti version in production to ensure that new changes do not break your site. Until Plenti reaches a stable v1.0.0 release, the API might change periodically, so it's a good idea to test newer versions locally before pushing to a live site. Otherwise if you're simply pulling in the latest version, every change made by a content editor will grab the newest release and that may not be compatible with your current codebase. Here's an example of locking your Plenti version to v0.6.62 (just replace that with whatever version you want to use):

image: docker:stable

pages:
  before_script:
    - apk add --update curl wget && rm -rf /var/cache/apk/*
  script:
    - wget https://github.com/plentico/plenti/releases/download/v0.6.62/plenti_0.6.62_linux_64-bit.tar.gz
    - tar -zxvf plenti_0.6.62_linux_64-bit.tar.gz
    - ./plenti build
  artifacts:
    paths:
      - public
  only:
    - master