ref
parameter can be any named branch, tag, or SHA. At GitHub Enterprise Server we often deploy branches and verify themenvironment
parameter allows deployments to be issued to different runtime environments. Teams often haveproduction
, staging
, and qa
. This parameterproduction
.auto_merge
parameter is used to ensure that the requested ref is not behind the repository's default branch. Ifsuccess
required_contexts
parameter allows you to specify a subset of contexts that must be success
, or topayload
parameter is available for any extra information that a deployment system might need. It is a JSON texttask
parameter is used by the deployment system to allow different execution paths. In the web world this mightdeploy:migrations
to run schema changes on the system. In the compiled world this could be a flag to compile anrepo
or repo_deployment
scopes can create a deployment for a given ref.master
in the response exampleauto_merge
option is enabled and when the default branch (in this case master
), can'ttopic-branch
), due to merge conflicts.required_contexts
parameter indicates that one or more contexts need to have a success
success
.curl --location --request POST 'https://api.github.com/repos///deployments' \
--header 'Content-Type: application/json' \
--data-raw '{
"auto_merge": false,
"description": "Deploy request from hubot",
"payload": "{ \"deploy\": \"migrate\" }",
"ref": "topic-branch",
"required_contexts": [
"ci/janky",
"security/brakeman"
]
}'
{
"created_at": "2012-07-20T01:19:13Z",
"description": "Deploy request from hubot",
"environment": "production",
"id": 42,
"node_id": "MDEwOkRlcGxveW1lbnQx",
"original_environment": "staging",
"performed_via_github_app": {},
"production_environment": true,
"repository_url": "https://api.github.com/repos/octocat/example",
"statuses_url": "https://api.github.com/repos/octocat/example/deployments/1/statuses",
"task": "deploy",
"transient_environment": true,
"updated_at": "2012-07-20T01:19:13Z",
"url": "https://api.github.com/repos/octocat/example/deployments/1"
}