---
title: "Deploying build artifacts in your Node.js environment"
date: "2024-02-14T06:18:38+00:00"
summary: "Learn how to efficiently deploy build artifacts in your Node.js environments using Acquia Cloud Platform. Discover step-by-step processes for same-environment deployments, moving code between environments, and reverting to previous versions."
image:
type: "page"
url: "/acquia-cloud-platform/add-ons/node-js/deploying-build-artifacts-your-nodejs-environment"
id: "861782dc-28d6-43df-b6be-8899fef8ad8d"
---

Cloud Platform Node.js applications have two types of environments: _development_ and _production_. These environments leverage [Pipelines](/acquia-cloud-platform/features/pipelines) for building applications and adding them to your environments.

When you have a build artifact, you can deploy it from one environment to another in a [workflow similar to your](/acquia-cloud-platform/features/pipelines) Cloud Platform environment.

The **Code** elements of the Cloud Platform Environments webpage provide a user interface for deploying build artifacts from your repository to your application’s environments. When you commit an artifact to your repository, Cloud Platform updates the environment running that build artifact. You must then deploy that artifact to make it available for use.

Important

You should make and test changes to your application in your Development environment only. Do not make or test changes in your Production environment. If you make a change that breaks your application in the Production environment, you might bring your live application down. If this happens, your application will fail to start, and will retry on a regular basis. Failures [are logged](/acquia-cloud-platform/monitor-apps/logstream).

Complete the following steps when you’re ready to deploy a build artifact to an environment:

1.  Check out your repository to your local computer.
    
2.  Use Pipelines to create a build artifact—artifacts are not deployed by Cloud Platform.
    
3.  Deploy your artifact, either in the [same environment](#deploy-artifact-same-env) or [between environments](#nodejs-move-code).
    

Note

In general, Node.js applications should have little downtime due to deployment. Although artifacts can take several seconds to build and deploy, application processes are rotated with new deployment code, with the platform waiting for your service to be listening before switching to the next process.

Deploying a build artifact in the same environment
--------------------------------------------------

Use one of the following methods to deploy one of your 50 most recent build artifacts in the same environment:

*   Using the **Environments** page
    
    To switch the code deployed in an environment from one artifact to another, using the **Environments** page, complete the following steps:
    
    1.  In the **Code** element for the environment, click the code switch button.
        
        ![Switching code](https://acquia.widen.net/content/08znrrddmc/png/cloud-platform_switching-code.png?crop=false&position=c&color=ffffffff&u=r1vkzh&w=500&h=300)
        
    2.  In the **Switch artifact** dialog box, select an artifact, and then click **Continue**.
        
    3.  In the **Switch artifact** confirmation dialog box, click **Switch**.
        
    
    When you select build artifact to deploy, that code is retrieved from your repository and deployed to the appropriate environment on the web infrastructure. The deploy task appears in the [Activity task list](/acquia-cloud-platform/monitor-apps/tasks).
    
*   From the **Environment Overview** page
    
    You can deploy an artifact on an environment or copy an artifact from one environment to another using the Overview page of an environment. To switch the code deployed in an environment from one artifact to another, using the Overview page, complete the following steps:
    
    1.  On the **Environments** page, click the name of the environment to open that environment’s **Overview** page.
        
    2.  On the **Overview** page for the environment, click **Switch**.
        
    3.  In the **Switch artifact** dialog box, select a build artifact, and then click **Continue**.
        
    4.  In the **Switch artifact** confirmation dialog box, click **Switch**.
        
    

Moving code from one environment to another
-------------------------------------------

To move code from one environment to another, use one of the following processes, depending on your location in the Cloud Platform interface:

*   From the **Environments page**
    
    1.  Drag a **Code** element from **Dev** to **Prod**. A **Deploy artifact** confirmation appears.
        
    2.  Click **Deploy**.
        
        ![Deploying code](https://acquia.widen.net/content/89qf3tx4sl/png/cloud-platform_deploying-code.png?crop=false&position=c&color=ffffffff&u=r1vkzh&w=700&h=500)
        
*   From the **Environment Overview** page
    
    To copy code from one environment to another (creating a new tag and deploying it) using the Overview page:
    
    1.  On the **Environments** page, click the name of the environment to open that environment’s **Overview** page.
        
    2.  On the **Overview** page for the environment, click **Deploy**.
        
    3.  In the **Deploy artifact** dialog box, select the artifact to copy, and then click **Continue**.
        
    4.  In the **Deploy artifact** confirmation dialog box, click **Deploy**.
        

Reverting code
--------------

To revert code to an earlier version:

1.  In the **Code** element for the environment, click the code switch button.
    
2.  In the **Switch artifact** dialog box, select the tag for the version to which you want to revert, and then click **Continue**.
    
3.  In the **Switch artifact** confirmation dialog box, click **Switch**.
    

When you deploy a previous build artifact, Cloud Platform retrieves the code snapshot from your repository and then deploys it on the appropriate environment on the web infrastructure.