App Deployment

The tag and snap pipelines of an app component include an additional build task that deploys the app's artifacts.

To snap and deploy your app, run the following:

$bit
Copiedcopy
See command synopsis

To snap with a release version, and deploy your app, run the following:

$bit
Copiedcopy
See command synopsis

Use a deployer

Bit's official Vue application type does not provide its own deployer. Search bit.cloud for a deployer, and set it in your app's plugin file.

For example:

Run the following to install the Netlify deployer:

$bit
Copiedcopy

Set the Netlify deployer in your app plugin file (my-app.bit-app.ts):

// my-app.bit-app.ts

import { VueApp } from '@bitdev/vue.app-types.vue-vite';
import { Netlify } from '@teambit/cloud-providers.deployers.netlify';

const netlifyConfig = {
  // The slug of your Netlify profile.
  team: '<your-slug>',
  // The access token of your Netlify profile.
  accessToken: process.env.NETLIFY_AUTH_TOKEN || '',
  // The name of the site to deploy to when bit tag.
  productionSiteName: '<your-site-name>',
  // The name of the staging site to deploy to when bit snap. (optional)
  stagingSiteName: '<your-staging-site-name>',
};

export default VueApp.from({
  // ...
  deploy: Netlify.deploy(netlifyConfig),
  // ...
});
CopiedCopy
Create a custom deployer

To create your own deployer, fork an existing deployer component or start from scratch. Learn more in Customizing the app deployment

Deploy using your CI

You can choose not to use the deployment function, and instead deploy the app's artifacts using your existing CI. For this, make sure to disable you deployment function, and to snap your app component (artifacts can only be extracted from a snap).

$bit
Copiedcopy
See command synopsis

The artifacts are now available in the new build directory, at the root of your project. Use this directory to deploy with your existing tools and workflows. For example:

$netlify deploy --dir=build
Copiedcopy