Turn on deploy on push
Make an app built from a repository deploy every push to its branch, or stop it from doing so.
With deploy on push, the pushed commit is built and rolled out as the person who pushed, with the
trigger push in the deployment history. Merging a pull request into the branch counts as a push.
Every push deploys, whichever files it changed: a push that only touches files outside the app's
root directory still rolls out. A new app connected to a repository has it on unless you turn it
off (Deploy on push in Create app, or deployOnPush: false). While it is off, the app's
Deployments tab says that pushes to the branch do not deploy it.
Prerequisites
- An app connected to a repository: built from it, or running a compose file read from it.
- Permission for
deploy:UpdateAppon the app. - For each push to deploy, the person who pushed needs
deploy:DeployAppon the app. - In the console, also
deploy:DescribeAppto open the app's page (without it the page is not found).
Turn it on or off
- Open the app's Runtime tab.
- Under Deploy on push, select or clear Deploy every push to branch. The change is
saved at once; there is no Save button. Without
deploy:UpdateAppthe check box is unavailable and the panel says "Changing this needs permission to update the app."
dcloud deploy apps update app-id --deploy-on-push--no-deploy-on-push turns it off. Replace app-id with the app's id.
PATCH /deploy/api/apps/3f1c2b4a-5d6e-4f70-8a91-b2c3d4e5f601
{ "deployOnPush": true }resource "dcloud_app" "web" {
name = "my-app"
builder = "dockerfile"
git_repository_id = dcloud_git_repository.api.id
deploy_on_push = true
}Result
The change applies from the next push. A push by someone without deploy:DeployApp is not
deployed, and the app's activity says so, for example: Push a1b2c3d to main by jane-doe did not
deploy: jane-doe may not deploy this app (deploy:DeployApp). A push that does deploy is noted
too: Push a1b2c3d to main by jane-doe: deploying it as generation 8.