To enable Atomic deployment, you must have a web application on your server that uses Git. If you don’t have one set up yet, you can refer to our previous knowledge base article to learn how to do that.

If you already have a web application connected to RunCloud using Git, you can continue setting up Atomic deployment.

Start by clicking on “Atomic Deployment” in the left side menu, and then sekect “Deploy a Project“.

On the next screen you’ll need to provide a name for your project. This can be different from the name of your web application.

Next, select the desired web application from the drop down menu.

Note: Once you enable Atomic deployment, it can not be reverted. Make sure that you understand the risks associated with it – and proceed with caution.

After selecting the app, click on “Save Project” to enable Atomic deployment.

Once you have enabled Atomic deployment, you will see a screen similar to the above screenshot.

We need to add the given Webhook URL to the Git repository so that RunCloud can deploy a new version of your application when a change is detected.

Go to your Git dashboard and look for the webhook settings. Click on “Add a webhook“, then copy the webhook URL from the RunCloud dashboard and paste it in the provided field. Make sure to change the content type to “application/json“.

Finally, click on “Add webhook” to save the changes.

That’s it! Now your live site will be automatically updated when a change is detected in the Git repository.

Testing Atomic Deployment

To make sure everything is working smoothly, let’s make a small change in the Git repository, and see how it affects the live site.

For the sake of simplicity, we are editing a static HTML file in the GitHub editor, but the process remains the same when you make changes in your local development environment, and push changes via CLI.

After pushing a commit to the correct branch, RunCloud will automatically update your live site within a few seconds. You can check the previous deployments in the RunCloud dashboard.

In the above example, we can see the name of the deployment is the same as our commit message. We can also click on the Deployment to see the status of each stage in deployment.

If a deployment fails for whatever reason, you can also see the build logs to quickly get to the bottom of the issue.