---
title: "Deployment workflow"
date: "2026-01-12T08:47:14+00:00"
summary:
image:
type: "page"
url: "/acquia-cloud-platform/add-ons/node-js/deployment-workflow"
id: "8c46a244-5275-4e1c-920f-ad09d6d292b4"
---

The **Code** elements of the Cloud Platform _Environments_ page provide a user interface for deploying code from your repository to your application's environments. When you commit a branch to your repository, Cloud Platform updates the environment that executes that code branch.

Make and test changes to administrative configurations, views, and other major application settings only in your non-production environments. Do not make or test changes in your production environment. If you make a change that breaks your application in the production environment, your live application may become unavailable.

To deploy code to an environment:

1.  Check out your repository to your local machine.
2.  Make changes to your application in the `/master` directory, or whatever branch you have configured to deploy for the development environment. Any environment that deploys a branch deploys all commits to that branch immediately.
3.  Do not deploy the master branch on your production environment; code committed to `master` would then deploy immediately in your live application, before you have a chance to test it.
4.  To change the code on your infrastructure, select one of the following methods:
    *   Commit changes to the currently deployed branch.
    *   Select a different repository branch or tag to deploy.
5.  Deploy your code, either in the [same environment](#deploy-same) or [between environments](#move).
6.  [Clear Varnish cache](/acquia-cloud-platform/using-varnish "Using Varnish"). Clear caches on a production environment with caution, especially when the system is under load. Schedule Varnish cache clears during periods of low user activity to minimize impact.

Deploying code in the same environment
--------------------------------------

You can deploy a different branch or tag in the same environment from the [Environments page](#cloud-deploy-code-envs-page) or the [Environments overview page](#cloud-deploy-code-overview-page).

### Deploying code from the Environments page

To switch the code deployed in an environment from one tag or branch to another:

1.  In the `Code` element for the environment, click the **code switch** button.
    
    ![nodejs_deploying-code-from-the-environments-page](https://acquia.widen.net/content/d6fb341e-78e7-416f-b1ed-cc3530f647b2/web/f0623_nodejs_deploying-code-from-the-environments-page.png?w=406&itok=GJnn1ggH)
    
2.  In the _Switch code_ dialog box, select a tag or branch from the _Select branch_ menu and click **Continue**. In the _Switch code_ confirmation dialog box, click **Switch**.

When you select a new branch or tag to deploy, Cloud Platform retrieves code from your repository and deploys it to the appropriate environment on the infrastructure. The deploy task appears in the _Activity_ task list.

### Deploying code from the Environment Overview page

You can deploy code on an environment or copy code from one environment to another from the _Overview_ page of the environment.

To switch the code deployed in an environment from one tag or branch to another:

1.  On the _Environments_ page, select an environment to view the corresponding _Overview_ page.
2.  In the _Code_ section, click **Switch**.
    
    ![nodejs_deploying-code-from-the-environment-overview-page](https://acquia.widen.net/content/41fd1f10-18c7-4440-abff-117bd9a13942/web/bb3e6_nodejs_deploying-code-from-the-environment-overview-page.png?w=720&itok=SsZJ4sL7)
    
3.  In the _Switch code_ dialog box, select a tag or branch from the _Select branch_ menu and click **Continue**.
4.  In the _Switch code_ confirmation dialog box, click **Switch**.

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

To move code from one environment to another, such as `Dev` to `Stage` or from `Stage` to `Prod`, 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 one environment to another environment. Cloud Platform creates a new tag for the head version of the branch (the most recently committed code version) and then deploys the tag in the environment you selected. For example, drag your _Dev Code_ element to **Stage**.
        
        ![nodejs_moving-code-from-one-environment-to-another](https://acquia.widen.net/content/ddf34ebd-247d-4370-a68b-0aaa8f790b71/web/73540_nodejs_moving-code-from-one-environment-to-another.png?w=720&itok=0FhLqYNU)
        
        Alternatively, you can add a `commit message`.
        
    2.  Click **Deploy**.
    
    When you drag your _Dev_ code container to the _Stage_ environment, Cloud Platform creates a symbolic link between the Staging environment and the head version (the most recently committed code version) of trunk in your Development environment. When you click **Deploy**, Cloud Platform creates a tag and updates the infrastructure to that version of your code. The default tag format is `yyyy‐mm‐dd.version` (for example, `tags/2016‐09‐18`). From the example, the next tag you create is `2016‐09‐18.0`.
    
    When you have a version ready to deploy to your live production application, drag your code element from the _Stage_ environment to _Prod_. If the staging environment is running a tag, that same tag is deployed into production.
    
*   From the _Overview_ page of an environment
    
    To copy code from one environment to another (creating and deploying a new tag) from 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 code_ dialog box, select the environment from which you want to copy a tag or branch, and click **Continue**.
        
        ![cloud-platform_clicking-deploy.png](https://acquia.widen.net/content/06c0c87c-2d84-4336-8183-2cce5fc075b6/web/cloud-platform_clicking-deploy.png?w=480&itok=0x5Ijv17)
        
    4.  In the _Deploy code_ confirmation dialog box, enter a commit message that describes the new deployment, and 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 code_ dialog box, select the tag for the version to which you want to revert, and then click **Continue**.
3.  In the _Switch code_ confirmation dialog box, click **Switch**.

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

Related topics
--------------

*   [Using your code repository](/acquia-cloud-platform/develop-apps/repository)
*   [Using the Live Development mode](/acquia-cloud-platform/manage-apps/code/livedev)