Deploy apps

Deploy your Bit applications easily with a deployer. For a React app, add the Netlify deployer like this:

// my-app.bit-app.ts
import type { ViteReact } from '@bitdev/react.app-types.vite-react';
import { Netlify } from '@teambit/cloud-providers.deployers.netlify';

export const MyApp = ViteReact.from({
  name: 'my-app',
  deploy: Netlify.deploy(),
});

export default MyApp;
CopiedCopy

To explore application deployment in detail, refer to the Deploying Applications documentation.

Platform deployment

Harmony platform build result in build artifacts that are simple to scale and deploy. They allow for optimization and scale of applications based on business needs while keeping code organization independent from your production infrastructure.

Orchestration of a platform deployment on a Kubernetes cluster
Orchestration of a platform deployment on a Kubernetes cluster

Using Bit and Harmony, you can produce a single binary build artifact for each of your application runtimes, the produced output of a standard platform build includes:

  • Binary artifact for the backend.
  • Code splitted and optimized UI application bundle.

This allows for optimized security, safety and performance for your software.

To configure the default Kubernetes deployer, use the following aspects in your application shell:

import { KubernetesAspect } from '@bitdev/symphony.deployers.kubernetes';
import { SymphonyPlatformAspect } from '@bitdev/symphony.symphony-platform';

export const MyPlatform = HarmonyPlatform.from({
  name: 'my-platform',
  platform: [SymphonyPlatformAspect],
  
  aspects: [[
    KubernetesAspect, {
      auth: {
        // configure your kubernetes cluster.
        basic: {
          server: 'http://1.2.3.4',
          token: process.env.KUBE_USER_TOKEN
        }
      },
      // configure your docker registry.
      docker: {
        imagePrefix: 'dockerhub-account'
        username: 'ci-user',
      }
  }]],
});
CopiedCopy

Once configured, the shell application deployment pipelines are being invoked upon release using the tag or snap commands:

bit tag --message 'releasing my feature' --major
CopiedCopy

Ensure to configure the environment variable secrets in Ripple CI secrets for them to be available through deployment.

Initiate the release CI job:

bit export
CopiedCopy

The CI pipeline automatically releases your application to the specified Kubernetes cluster. You can adjust the deployment of each runtime to use the below list of supported deployers or build your own.

Officially supported deployers

Deploy your applications seamlessly using our official deployers:

To discover other deployers or to create your own, visit the Building app deployers documentation.

Effortless deployments with Ripple CI

Once you've configured a deployer, use bit tag and let Ripple CI handle your production or staging deployments automatically. Create a lane to preview your changes in a dedicated staging environment for a streamlined workflow.

Staging deployments

You can deploy your apps to a staging environment using a Lane and one of our official deployers. Configure your desired deployer, export the Lane with bit export, and your app will be deployed to staging.

Create a lane:

bit lane create introducing-billing
CopiedCopy

Create a new version:

bit snap --message 'building the billing aspect'
CopiedCopy

Initiate the deployment job:

bit export
CopiedCopy

For a comprehensive guide on creating lanes and managing change requests, refer to the Change Requests documentation.

Learn more