Deploy to Scalingo from GitLab CI/CD

This page describes steps to setup Continuous Deployment from GitLab CI/CD to Scalingo. Follow this guide to automatically deploy to Scalingo after a successful build.

Setup GitLab CI/CD Steps

Deploying to Scalingo is simplified by the dpl tool. To trigger a deployment after a success build on GitLab CI/CD, here are the steps to configure in your .gitlab-ci.yml:

deploy:development:
  stage: deploy
  variables:
    SCALINGO_APP_NAME: <app name>
    SCALINGO_REGION: osc-fr1
  dependencies:
    - test:rspec_models
    - test:rspec_controllers
    - test:rspec_features
  only:
    - develop
  script:
    - gem install dpl --pre
    - dpl --provider=scalingo --app=$SCALINGO_APP_NAME --api-token=$SCALINGO_API_TOKEN --region=$SCALINGO_REGION --branch=refs/heads/master

Specifying the remote branch (--branch) is necessary, otherwise you will get an error (unable to push to unqualified destination: master).

Scalingo API Token

The variable SCALINGO_API_TOKEN must be an API token available on the ‘Profile’ page of the Scalingo Dashboard. Do NOT store this token in the .gitlab-ci.yml file. Please refer to this GitLab documentation page.


mode_edit Suggest edits