Create and manage deployments

  • Apps Script project deployments make script versions available for use as web apps, add-ons, or API executables.

  • There are two types of deployments: Head deployments, which are always synced to the current project code and used for testing, and Versioned deployments, which are connected to a specific project version and used for public consumption.

  • You can create, view, edit, and find the ID of versioned deployments through the Deploy > Manage deployments menu in your Apps Script project.

  • You can test deployments differently depending on the type of app you build, with specific instructions for Google Workspace add-ons, Editor add-ons, web apps, Google Chat apps, and API Executables.

  • Versioned deployments cannot be deleted but can be archived and redeployed through the Deploy > Manage deployments menu.

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

There are two types of deployments:

  • Head deployments, which always sync to the current project code.
  • Versioned deployments, which connect to a specific project version.

Head deployments

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

The head deployment always syncs with the 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.

There is only one head deployment for each Apps Script project. To use a head deployment, you must have at least read access to the script project.

Versioned deployments

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

When you publish an application for public use, always use a versioned deployment. You can have multiple active versioned deployments at once.

Important: You cannot transfer ownership of versioned deployments. If you transfer ownership of a script project, the owner of the existing versioned deployments doesn't change. If an administrator deletes the deployment owner's account, their deployments might experience script errors.

Create a versioned deployment

To deploy a version of a add-on, Editor add-on, Chat app, 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:

  1. Open the Apps Script project. <<../_common/snippets/create-new-deployment.md>>

Each new deployment can be shared as a library. If you share the script as a library, the deployment description is visible to library users.

View versioned deployments

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

To view the code of a specific version, refer to View a previous version.

Edit a versioned deployment

You can edit a versioned deployment to change its description or version. To edit a deployment:

  1. Open the Apps Script project.
  2. Click Deploy > Manage deployments.
  3. Select the active deployment and click Edit .
  4. Make your changes and click Deploy.

To edit an archived deployment, redeploy it and then follow the preceding steps.

To deploy a change to the project code, create a new version and edit the deployment to use it. The deployment automatically uses the new version for all users.

Find a deployment ID

Every deployment has an associated string ID. To find this ID:

  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.

Test a deployment

The method for testing a deployment depends on the type of app you build.

Google Workspace add-on

To test a add-on deployment, see Testing 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.

Google Chat app

To test a Chat app deployment, create a versioned deployment of the script to access its deployment ID.

After you have the deployment ID, specify the ID in the Chat API configuration and follow the steps to test interactive features.

API Executable

To test an API executable deployment, create a versioned deployment. After you create a deployment, follow these steps:

  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.

Archive a versioned deployment

You can't delete versioned deployments. Instead, you can archive them.

To archive a versioned deployment:

  1. Open the Apps Script project.
  2. Click Deploy > Manage deployments.
  3. Select the deployment and click Archive deployment .

Redeploy an archived deployment

  1. Open the Apps Script project.
  2. At the top right, click Deploy > Manage deployments.
  3. Under Archived, select the deployment and click Edit > Deploy.