Skip to main content

Continuous Integration & Delivery (CI/CD)

This page is an agnostic overview of how to use our platform to build and deploy your project with a platform like GitHub Actions or GitLab CI. This will give you keys to create the perfect script to deploy your project. There is an example for GitHub Actions and GitLab CI at the end of this page.

Environment variables

First of all, you need to define the environment variables you need to deploy successfully your project. You need at least two values to use them with the CLI:

  • your project's name
  • your project's environment
env:
ORG_PROJECT: my-project
DEPLOY_ENV: test

Login

To deploy, you need to be connected to your ScaleDynamics account. The easiest way to do it with a CI is to use an API key. You can create one in the API key section of your organization in the ScaleDynamics console.

The API key require Administrator rights.

- name: Connection to ScaleDynamics
run: npx warp login --api-key=${{ secrets.SCALEDYNAMICS_API_KEY }}

Deploy

To deploy your project, you need to use the environment variables defined earlier and use it with the CLI.

- name: Deploy application
run: npx warp deploy --project ${ORG_PROJECT} --env ${DEPLOY_ENV}

Other

You can pretty much add anything else you need to do with your project. Add unit tests, build your project if needed, lint your code, etc.

Example

name: deploy

# Controls when the workflow will run
on:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
deploy:
runs-on: ubuntu-latest
env:
ORG_PROJECT: my-project
DEPLOY_ENV: test
steps:
- uses: actions/checkout@v2

- name: Install dependencies application
run: npm ci

# Create an API key in the console and use it for connection (you can add it as a secret)
- name: Connection to ScaleDynamics
run: npx warp login --api-key=${{ secrets.SCALEDYNAMICS_API_KEY }}

- name: Build project
run: npm run build

- name: Deploy application
run: npx warp deploy --project ${ORG_PROJECT} --env ${DEPLOY_ENV} --force