#How to prevent autodeployment of all projects associated with same repo but different branch?
1 messages · Page 1 of 1 (latest)
You can prevent unnecessary deployments by configuring the Ignored Build Step setting on each project. This setting allows you to specify conditions under which the build step should be ignored.
For each project, you can set the Ignored Build Step to git diff HEAD^ HEAD --quiet . and click Save. This command checks if there are any changes in the project's directory. If there are no changes, the build step is ignored.
Here's how you can do it:
- Go to the Git section of the Project Settings.
- Set the Ignored Build Step to
git diff HEAD^ HEAD --quiet . - Click Save.
This configuration ensures that a deployment is triggered in a project only when a change happens in the project's directory. For example, for the create-react-app project, a deployment will be triggered only when a change happens in apps/frontend. Similarly, for the Nextjs project, a deployment will be triggered only when a change happens in apps/nextapp.
Please note that the directory you set for this command to return true on is ., referring to the root folder. This is because you have configured the root of the project to be the application's folder such as apps/frontend or apps/nextapp.