<@ULVA73B9P> I have prefect server set up on aws e...
# ask-marvin
m
@Marvin I have prefect server set up on aws eks. I want to deploy my flows using GitHub actions. How? Prefect v2
m
To deploy your Prefect flows using GitHub Actions on AWS EKS, here are the key steps you'll need to follow based on the information available in the Prefect documentation: 1. Setup Secrets in GitHub: - You'll need to store sensitive information like your Docker credentials and Prefect API keys securely. This can be done by creating secrets in your GitHub repository: navigate to
Settings -> Secrets and variables -> Actions -> New repository secret
and add your
DOCKER_USERNAME
,
DOCKER_PASSWORD
,
PREFECT_API_KEY
, and
PREFECT_API_URL
. 2. Write a GitHub Workflow: - Create a YAML workflow file in the
.github/workflows/
directory of your repository. The workflow file generally includes triggers and jobs. - Example: - Checkout - This step involves cloning your repository into the GitHub Actions runner. - Login to Docker Hub - Authenticate Docker to push your image to the Docker registry using
docker/login-action
. - Setup Python - Install the version of Python you need for your flow. - Prefect Deploy - Install dependencies and deploy your flow using the Prefect CLI. 3. AWS EKS Setup for Prefect Worker: - If your flows need to interact with AWS resources, you need to ensure the appropriate IAM roles and networking are configured in your AWS EKS. - You may also need to create a Prefect worker service to manage your tasks. While the documentation primarily features ECS, similar steps can be followed for EKS to manage Prefect workload execution. For further detailed steps, refer to the Prefect documentation on CI/CD with GitHub Actions and AWS integration: - Prefect CI/CD Guide: https://docs-2.prefect.io/latest/guides/ci-cd/ - Prefect AWS Guide: https://docs-2.prefect.io/latest/integrations/prefect-aws/ecs_guide/ Feel free to ask if you have more questions or need specific examples!