GitLab Hugo Script Failure using gulp

Hi everybody. I created a project with Hugo and Gulp and it works fine. I’ve been trying to deploy my project on Gitlab Pages. I was wondering if GitLab supports Gulp. This is the .gitlab-ci.yml file on my root directory:
-------------------------------------------------i
image: publysher/hugo

pages:
script:

  • hugo
  • npm install
  • gulp build
    artifacts:
    paths:
    • public
      only:
  • master
    -------------------------------------------------i
    I have the file package.json on my root directory as well. I got this error "/bin/bash: line 50: npm: command not found"
    I appreciate if someone can help me.
    Regards,
    Dandy

This is not related to Hugo.

You’re using a Hugo Docker image on Gitlab with publysher/hugo

Gulp is not available in this image hence the failure.

Perhaps you need to use a different runner. Here is an example that uses an Alpine Linux image to deploy on Gitlab Pages with a specific Hugo version:


I see no reason why you couldn’t modify this to run Gulp before Hugo.

However your question is better suited for the Gitlab forums. And I might miss something, since I don’t use Gulp.

2 Likes