As a professional AI assistant within PantheraHive, I have executed the "DevOps Pipeline Generator" workflow based on your request.
Here's a comprehensive CI/CD pipeline configuration designed for an "AI Technology" project, leveraging GitHub Actions for its flexibility and wide adoption. This pipeline includes robust stages for linting, testing, building a Docker image, and deploying to a cloud environment.
Workflow Description: Generate complete CI/CD pipeline configurations for GitHub Actions, GitLab CI, or Jenkins with testing, linting, building, and deployment stages.
User Inputs:
This GitHub Actions CI/CD pipeline is tailored for an AI Technology project, typically involving Python-based applications, machine learning models, or data processing services. It automates the process from code commit to deployment, ensuring code quality, functionality, and consistent delivery.
Key Stages:
Assumptions:
requirements.txt for dependencies.pytest.black and isort.mypy.Dockerfile is present in the repository root for containerization..github/workflows/ai-ci-cd.yml)Create a file named ai-ci-cd.yml (or similar) in your repository's .github/workflows/ directory.
## 3. Essential Project Files & Configurations For the pipeline to function correctly, ensure the following files and configurations are in place in your repository: ### 3.1 `Dockerfile` Example Create a `Dockerfile` in your repository root:
Navigate to your GitHub repository settings (Settings > Secrets and variables > Actions) and add the following repository secrets:
DOCKER_HUB_TOKEN (Optional): If pushing to Docker Hub, an access token for docker.io/${{ github.repository_owner }}. For GHCR, GITHUB_TOKEN is automatically available.AWS_IAM_ROLE_ARN: The Amazon Resource Name (ARN) of an IAM role that GitHub Actions can assume. This role must have permissions to: * ecs:DescribeTaskDefinition
* ecs:RegisterTaskDefinition
* ecs:UpdateService
* ecs:DescribeServices
* ecs:DescribeClusters
* ecs:WaitServicesStable
* ecr:GetAuthorizationToken (if using ECR instead of GHCR)
* This role should have a trust policy allowing sts:AssumeRoleWithWebIdentity from token.actions.githubusercontent.com.
CODECOV_TOKEN (Optional): If you plan to upload coverage reports to Codecov.io.For the deploy job, it's highly recommended to use GitHub Environments for stricter control over deployments (e.g., manual approvals, environment-specific secrets).
Settings > Environments.New environment, name it production..gitlab-ci.yml format, using GitLab's built-in Docker services and registry.pre-commit hooks for local linting and formatting before pushing code, catching issues earlier.* SAST (Static Application Security Testing): Integrate tools like Bandit (for Python) or GitHub's CodeQL for static code analysis.
* DAST (Dynamic Application Security Testing): For deployed applications, tools like OWASP ZAP can scan for vulnerabilities.
* Dependency Scanning: Use tools like Dependabot (built-in to GitHub) or Snyk to check for known vulnerabilities in your dependencies.
staging environment first, with manual approval before production.This GitHub Actions pipeline provides a robust foundation for building, testing, and deploying your AI Technology project. By following these configurations and recommendations, you can establish a professional, efficient, and reliable CI/CD workflow. Remember to adapt the specific commands and configurations to match your project's unique requirements and chosen cloud provider services.
\n