In Prefect 2.x, the concept of deploying flows has been updated. Unlike Prefect 1 where flows needed to be registered, Prefect 2 introduces the concept of Deployments. A Deployment specifies the entry point to your flow code and can optionally specify various details, including:
- Where to run your flow (your infrastructure, such as a Docker container, Kubernetes job, or ECS task).
- When to run your flow (a schedule such as an interval, cron, or RRule).
- How to run your flow (execution details such as parameters).
From the information provided, it does not seem that prefect directly supports automatic deployment upon flow editing out of the box. However, you can set up a CI/CD pipeline using tools like GitHub Actions, GitLab CI, or Jenkins to automatically deploy your flow to Prefect every time you make changes to your flow script and push it to your version control repository.
Prefect Cloud also offers additional features which might facilitate automations. However, the specific documentation on whether Prefect supports automatic redeployment after flow edits isn't detailed in the provided excerpts.
If you were to set up CI/CD for auto-deployment, you'd write scripts within your CI/CD pipeline that invoke Prefect CLI commands or use the Prefect Python client to update your deployments whenever changes are detected in your repository.
Please note that you may have to handle specific tasks like versioning, environment configuration, and testing within your CI/CD scripts to ensure robust deployment processes.