removing unused files #41
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI/CD Pipeline | |
| on: | |
| pull_request: | |
| branches: [ main, develop ] | |
| push: | |
| branches: [ main, develop ] | |
| tags: [ 'v*' ] | |
| env: | |
| REGISTRY: ghcr.io | |
| IMAGE_NAME: ${{ github.repository }} | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ["3.10", "3.11", "3.12"] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install pixi | |
| uses: prefix-dev/setup-pixi@v0.8.1 | |
| with: | |
| pixi-version: latest | |
| cache: true | |
| cache-write: ${{ github.event_name != 'pull_request' }} | |
| - name: Install dependencies with pixi | |
| run: pixi install | |
| - name: Install Playwright browsers | |
| run: pixi run playwright install chromium | |
| - name: Run complete quality checks | |
| run: pixi run quality | |
| - name: Run tests | |
| run: pixi run test | |
| - name: Validate orchestrator imports | |
| run: | | |
| pixi run python -c "from src.orchestrator import BatchOrchestrator, OrchestratorConfig; print('✅ Orchestrator imports successfully')" | |
| - name: Validate Kubernetes manifests | |
| run: | | |
| # Install yamllint via pip (outside pixi environment) | |
| pip install yamllint | |
| # Check YAML syntax | |
| echo "🔍 Validating YAML syntax..." | |
| yamllint deployment/kubernetes/*.yaml || echo "⚠️ YAML lint warnings found" | |
| # Install kubectl for manifest validation | |
| curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl" | |
| chmod +x kubectl | |
| sudo mv kubectl /usr/local/bin/ | |
| # Validate manifests syntax (offline validation) | |
| echo "🔍 Validating Kubernetes manifests..." | |
| for file in deployment/kubernetes/*.yaml; do | |
| echo "Validating $file..." | |
| kubectl apply --dry-run=client --validate=false -f "$file" || echo "⚠️ Validation failed for $file" | |
| done | |
| echo "✅ Kubernetes manifest validation completed" | |
| docker-build: | |
| needs: test | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Log in to Container Registry | |
| if: github.event_name != 'pull_request' | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ${{ env.REGISTRY }} | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Extract metadata | |
| id: meta | |
| uses: docker/metadata-action@v5 | |
| with: | |
| images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | |
| tags: | | |
| type=ref,event=branch | |
| type=ref,event=pr | |
| type=semver,pattern={{version}} | |
| type=semver,pattern={{major}}.{{minor}} | |
| type=raw,value=latest,enable={{is_default_branch}} | |
| - name: Build and push Docker image | |
| uses: docker/build-push-action@v5 | |
| with: | |
| context: . | |
| platforms: linux/amd64 | |
| push: ${{ github.event_name != 'pull_request' }} | |
| tags: ${{ steps.meta.outputs.tags }} | |
| labels: ${{ steps.meta.outputs.labels }} | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max | |
| security-scan: | |
| needs: docker-build | |
| runs-on: ubuntu-latest | |
| if: github.event_name != 'pull_request' | |
| permissions: | |
| contents: read | |
| security-events: write | |
| steps: | |
| - name: Run Trivy vulnerability scanner | |
| uses: aquasecurity/trivy-action@master | |
| with: | |
| image-ref: '${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest' | |
| format: 'sarif' | |
| output: 'trivy-results.sarif' | |
| - name: Upload Trivy scan results to GitHub Security tab | |
| uses: github/codeql-action/upload-sarif@v2 | |
| if: always() | |
| with: | |
| sarif_file: 'trivy-results.sarif' | |
| deploy-staging: | |
| needs: [test, docker-build] | |
| runs-on: ubuntu-latest | |
| if: github.ref == 'refs/heads/develop' | |
| steps: | |
| - name: Deploy to staging | |
| run: | | |
| echo "🚀 Deploying to staging environment" | |
| echo "Image: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:develop" | |
| # Add actual deployment commands here | |
| deploy-production: | |
| needs: [test, docker-build, security-scan] | |
| runs-on: ubuntu-latest | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| steps: | |
| - name: Deploy to production | |
| run: | | |
| echo "🚀 Deploying to production environment" | |
| echo "Image: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.ref_name }}" | |
| # Add actual deployment commands here |