Jekyll environment at build time not working


#1

I am using GitLab CI to build and deploy the Jekyll website but it is not working with the environments.


#2

Your statement hardly makes sense.
What environments?? What is the error?


#3

This is the gitlab-ci.yml file and here I have used the variable called JEKYLL_ENV: production and it is not working.

# This file is a template, and might need editing before it works on your project.
# Template project: https://gitlab.com/pages/jekyll
# Docs: https://docs.gitlab.com/ce/pages/
image: ruby:2.3

variables:
  JEKYLL_ENV: production

before_script:
- bundle install

test:
  stage: test
  script:
  - bundle exec jekyll build -d test
  artifacts:
    paths:
    - test

pages:
  stage: deploy
  script:
  - bundle exec jekyll build -d public JEKYLL_ENV=$JEKYLL_ENV
  artifacts:
    paths:
    - public
  only:
  - master

#4

Environment variables are generally passed before the command invocation:

JEKYLL_ENV=$JEKYLL_ENV bundle exec jekyll build -d public

#5

Tried that, still not working.