@@ -182,6 +182,8 @@ async def deploy(
182182 layers : Optional [List [str ]] = None ,
183183 env_vars : Optional [List [EnvVarInputForDeploy ]] = None ,
184184 labels : Optional [Dict [str , str ]] = None ,
185+ production : Optional [bool ] = None ,
186+ preview : Optional [bool ] = None ,
185187 ) -> Revision :
186188 """Deploy a revision by uploading source files as assets.
187189
@@ -192,6 +194,10 @@ async def deploy(
192194 layers: Layer IDs or slugs to reference for this revision.
193195 env_vars: Optional environment variables for this revision.
194196 labels: Optional labels (e.g., git metadata).
197+ production: Whether to deploy to the production timeline.
198+ Defaults to true on the server.
199+ preview: Whether to deploy as a preview deployment.
200+ Defaults to false on the server.
195201
196202 Returns:
197203 The created Revision (build is async; poll for status).
@@ -205,6 +211,10 @@ async def deploy(
205211 body ["env_vars" ] = env_vars
206212 if labels is not None :
207213 body ["labels" ] = labels
214+ if production is not None :
215+ body ["production" ] = production
216+ if preview is not None :
217+ body ["preview" ] = preview
208218 result = await self ._client .post (f"/api/v2/apps/{ app } /deploy" , body )
209219 return cast (Revision , convert_to_snake_case (result ))
210220
@@ -267,6 +277,8 @@ def deploy(
267277 layers : Optional [List [str ]] = None ,
268278 env_vars : Optional [List [EnvVarInputForDeploy ]] = None ,
269279 labels : Optional [Dict [str , str ]] = None ,
280+ production : Optional [bool ] = None ,
281+ preview : Optional [bool ] = None ,
270282 ) -> Revision :
271283 """Deploy a revision by uploading source files as assets.
272284
@@ -277,6 +289,10 @@ def deploy(
277289 layers: Layer IDs or slugs to reference for this revision.
278290 env_vars: Optional environment variables for this revision.
279291 labels: Optional labels (e.g., git metadata).
292+ production: Whether to deploy to the production timeline.
293+ Defaults to true on the server.
294+ preview: Whether to deploy as a preview deployment.
295+ Defaults to false on the server.
280296
281297 Returns:
282298 The created Revision (build is async; poll for status).
@@ -289,5 +305,7 @@ def deploy(
289305 layers = layers ,
290306 env_vars = env_vars ,
291307 labels = labels ,
308+ production = production ,
309+ preview = preview ,
292310 )
293311 )
0 commit comments