Skip to content

Commit 9056ae5

Browse files
committed
Refactor deployment function; switch to using flow.deploy() method and remove Git storage configuration
1 parent 5fc1165 commit 9056ae5

1 file changed

Lines changed: 4 additions & 14 deletions

File tree

src/progressive_automations_python/prefect_flows.py

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
"""
66

77
from progressive_automations_python.desk_controller import move_to_height
8-
from prefect.deployments import Deployment
9-
from prefect.runner.storage import GitRepository
108

119

1210
# =============================================================================
@@ -23,24 +21,16 @@ def deploy_move_desk_flow(deployment_name: str = "move-desk"):
2321
str: The deployment name for reference
2422
"""
2523

26-
# Create deployment with Git source
27-
deployment = Deployment.build_from_flow(
28-
flow=move_to_height,
24+
# Deploy using the modern flow.deploy() method
25+
deployment_id = move_to_height.deploy(
2926
name=deployment_name,
3027
work_pool_name="desk-lifter-pool",
31-
storage=GitRepository(
32-
url="https://github.com/AccelerationConsortium/progressive-automations-python.git",
33-
branch="main"
34-
),
35-
entrypoint="src/progressive_automations_python/desk_controller.py:move_to_height"
28+
image=None, # Use default image
29+
push=False # Don't push to registry
3630
)
3731

38-
# Deploy it
39-
deployment_id = deployment.apply()
40-
4132
print(f"✅ Deployment '{deployment_name}' created with ID: {deployment_id}")
4233
print(f"Work pool: desk-lifter-pool")
43-
print(f"Source: GitHub repository")
4434
print(f"To run: prefect deployment run 'move-to-height/{deployment_name}' --param target_height=30")
4535
print(f"Parameter: target_height (float, in inches)")
4636

0 commit comments

Comments
 (0)