# Help! Is GitLab CI/CD Serverless deploy possible?

**URL:** <https://forum.serverless.com/t/help-is-gitlab-ci-cd-serverless-deploy-possible/15331>\
**Category:** Serverless Framework\
**Created:** [June 17, 2021, 12:26am UTC](https://forum.serverless.com/t/help-is-gitlab-ci-cd-serverless-deploy-possible/15331 "2021-06-17T00:26:39Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ajoslin103](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/ajoslin103/32/4823_2.png) [@ajoslin103](https://forum.serverless.com/u/ajoslin103)\
**Post date:** [June 17, 2021, 12:26am UTC](https://forum.serverless.com/t/help-is-gitlab-ci-cd-serverless-deploy-possible/15331/1 "2021-06-17T00:26:39Z")

</div>

I can not get Serverless deploy to work with GitLab CI/CD

Has anyone had success with deploying Serverless from GitLab CI/CD ?

---

<div class="post-metadata">

**Author:** ![ledere](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/ledere/32/5500_2.png) [@ledere](https://forum.serverless.com/u/ledere)\
**Post date:** [June 22, 2021, 5:55pm UTC](https://forum.serverless.com/t/help-is-gitlab-ci-cd-serverless-deploy-possible/15331/2 "2021-06-22T17:55:00Z")

</div>

hi ajoslin103,

I have done this so that every time new code is pushed to gitlab, a pipeline runs that deploys to my test environment. Just make sure that you include `serverless` as a dependency of your project

`npm i serverless --save`

then add the following to your .gitlab-ci. In my example, I cache all node\_modules so I don’t have to install them for every stage of my pipeline. And in the stage definition (deploy-test), I call upon the locally installed version of serverless.

```auto
image: node:latest
  
stages:
  - deploy

cache:
  key: ${CI_COMMIT_REF_SLUG}
  paths:
    - .npm/

before_script:
  - npm config set prefix /usr/local
  - npm ci --cache .npm --prefer-offline

deploy-test:
  stage: deploy
  script:
    - ./node_modules/.bin/serverless deploy
  environment: test

```

Hope this helps!

---

<div class="post-metadata">

**Author:** ![ajoslin103](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/ajoslin103/32/4823_2.png) [@ajoslin103](https://forum.serverless.com/u/ajoslin103)\
**Post date:** [June 22, 2021, 9:18pm UTC](https://forum.serverless.com/t/help-is-gitlab-ci-cd-serverless-deploy-possible/15331/3 "2021-06-22T21:18:57Z")

</div>

I found a project to clone that worked

Apologies - I should have returned and marked this solved

---

<div class="post-metadata">

**Author:** ![ledere](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/ledere/32/5500_2.png) [@ledere](https://forum.serverless.com/u/ledere)\
**Post date:** [June 23, 2021, 7:35am UTC](https://forum.serverless.com/t/help-is-gitlab-ci-cd-serverless-deploy-possible/15331/4 "2021-06-23T07:35:33Z")

</div>

no worries, glad it worked out for you
