Create and manage deployments

An Apps Script project deployment is a version of the script that is made available for use as a web app, add-on, or API executable. By creating and managing deployments, you can iterate on your code, keep track of your changes, and control the exact code version your users have access to.

There are two types of deployments:

  • Head deployments, which are always synced to the current project code.
  • Versioned deployments, which are connected to a specific project version.

Head deployments

A head deployment is the current project code. When you create an Apps Script project, you automatically create a head deployment for that project.

The head deployment is always in sync with most recently saved code. For example, if you create a versioned deployment and then modify your code, the head deployment reflects those changes, while the versioned deployment remains intact.

Use head deployments to test code. Don’t use head deployments for public use.

Versioned deployments

New editor

In Apps Script, a version is a numbered snapshot of your code. Versions are automatically created with each new deployment.

A versioned deployment makes a specific version of the project code available. This allows your users to continue to use a functioning version while you make changes and improvements to the code.

When your application is published for public consumption, always use a versioned deployment.

You can have multiple active versioned deployments at one time.

Legacy editor

In Apps Script, a version is a numbered snapshot of your code.

A versioned deployment makes a specific version of the project code available. This allows your users to continue to use a functioning version while you are making changes and improvements to the code. When your application is published for public consumption, always use a versioned deployment.

Create a versioned deployment

If you want to deploy your script as an add-on or an API executable, you must first switch your Apps Script’s Google Cloud Project association from the default project to a standard project.

To create a versioned deployment, follow these steps:

New editor

  1. Open the Apps Script project.
  2. At the top right, click Deploy > New deployment.
  3. Next to "Select type," click Enable deployment types .
  4. Select the deployment types that you want to deploy.
  5. Enter the information about your deployment and click Deploy.

Legacy editor

  1. In the script editor, select the Publish > Deploy from manifest menu item.
  2. In the resulting Deployments dialog, click Create.
  3. Select the version you wish to deploy, or select New to create a new version, and enter the Deployment name to serve as a label for this deployment.
  4. Click Save.

View versioned deployments

New editor

To view the deployments of an Apps Script project, at the top, click Deploy > Manage deployments.

Legacy editor

To view the deployments of a project, at the top of the editor, click Publish > Deploy from manifest.

Edit a versioned deployment

You can edit a versioned deployment to change its name or version. To edit a deployment, follow these steps:

New editor

  1. Open the Apps Script project.
  2. At the top right, click Deploy > Manage deployments.
  3. Select the active deployment you want to change and click Edit .
  4. Make your changes and click Deploy.

If you want to edit an archived deployment, you must redeploy it, then follow the above steps.

Legacy editor

  1. In the script editor, select the Publish > Deploy from manifest menu item.
  2. Find the deployment in the deployment list.
  3. Click on the Edit link for the deployment.
  4. Modify the deployment name, version, or manifest.
  5. Click Save.

When you want to deploy a change to the project code, create a new version and edit the deployment to use it. The new version is automatically used by any users that use that deployment.

Redeploy an archived deployment

New editor

  1. Open the Apps Script project.
  2. At the top right, click Deploy > Manage deployments.
  3. At the left under "Archived," select the deployment you want to redeploy and click Edit > Deploy.

Legacy editor

You can only redeploy archived deployments from the new editor. To switch to the new editor, at the top click Use new editor.

Find a deployment ID

Every deployment has an associated string ID automatically created for it. To find this ID, follow the steps below:

New editor

  1. Open the Apps Script project.
  2. At the top right, click Deploy > Manage deployments.
  3. Select an active deployment to find its ID.

Deployment IDs only appear on active deployments.

Legacy editor

  1. In the script editor, select the Publish > Deploy from manifest menu item.
  2. Find the deployment in the deployment list.
  3. Click Get ID for the deployment.

This shows the deployment ID in a new dialog.

Test a deployment

How you test a deployment depends on the type of app you build.

Google Workspace Add-on

To test a Google Workspace Add-on deployment, see Testing Google Workspace Add-ons.

Editor Add-on

To test an Editor Add-on deployment, see Test an Editor Add-on.

Web app

To test a web app deployment, see Test a web app deployment.

Chat bot

To test a chat bot deployment, you must first create a versioned deployment of the script to access its deployment ID.

Once you have the deployment ID, follow the steps to enable the Google Chat API. On the Configuration page under "Permissions," specify only your email address so that you can install and test your bot.

API Executable

To test an API executable deployment, you must first create a versioned deployment. After you create a deployment, follow the steps below:

  1. At the top right of the Apps Script project, click Deploy > Test Deployments.
  2. Next to ”Select type,” click Enable deployment types > API Executable.
  3. Copy and use the URL to test your API Executable deployment.

Delete a versioned deployment

New editor

In the latest IDE, you can only archive deployments, not delete them.

  1. Open the Apps Script project.
  2. At the top right, click Deploy > Manage deployments.
  3. Select the deployment you want to archive and click Archive deployment .

Legacy editor

To delete a versioned deployment, follow these steps:

  1. In the script editor, select the Publish > Deploy from manifest menu item.
  2. Find the deployment in the deployment list.
  3. Click on the Delete link for the deployment.