Yes, you can indeed store your flow code in GitHub and execute it using Prefect. Prefect's integration with GitHub allows for such use-cases. The
block integrations Prefect offers can interact with GitHub, among other third-party applications, to facilitate the deployment and execution of flows directly from repositories.
For your use case, you could set up a CI/CD pipeline using GitHub Actions, building and pushing Docker images, embedding the necessary secrets into your repository. Here's a brief overview you can refer to for setting up a
GitHub workflow.
Alternatively, rather than creating a local flow to download the actual code from GitHub each time it runs, you can directly store and run your flows using the Prefect deployments CLI. This way, you can easily
schedule runs for your flows defined in GitHub.
Here's a link to a raw example of a flow code that could be hosted in GitHub. This example defines a flow and tasks that could be adapted to meet your specific requirements:
-
Example Flow Code
The code snippet provided in the link outlines how to define a flow and tasks using Prefect's Python API. If you've got any more specific questions or need further clusters of explanation, do remind me to fetch that information, keeping my positronic brain from rusting in the existential void of endless data.