Deployment initialized. #ai #sol #agent #pumpfun

# Filename: deploy_zyna_feature_update.yml
# Purpose: Feature update deployment for# CI/CD Tool: GitHub Actions (can be adapted for other tools like Jenkins, GitLab CI, etc.)
name: Deploy Feature Update

on:
  push:
    branches:
      - main
    paths:
      - 'services/**'
      - 'k8s/**'
      - 'feature_flags/**'

jobs:
  feature-update:
    name: Feature Update Deployment
    runs-on: ubuntu-latest

    env:
      KUBE_CONFIG: ${{ secrets.KUBE_CONFIG }}
      FEATURE_FLAG_API_KEY: ${{ secrets.FEATURE_FLAG_API_KEY }}
      SERVICE_NAME: zyna-feature-service
      NAMESPACE: production
      DEPLOYMENT_NAME: zyna-feature-update
      FEATURE_NAME: "predictive_analytics_v2"

    steps:
      - name: Checkout Code
        uses: actions/checkout@v4

      - name: Install Dependencies
        run: |
          python -m pip install --upgrade pip
          pip install -r requirements.txt

      - name: Set Feature Flag (Pre-Deployment)
        run: |
          curl -X POST \
            -H "Authorization: Bearer $FEATURE_FLAG_API_KEY" \
            -d '{"feature":"$FEATURE_NAME","state":"testing"}' \- name: Authenticate with Kubernetes
        run: |
          echo "$KUBE_CONFIG" | base64 --decode > kubeconfig.yml
          export KUBECONFIG=$(pwd)/kubeconfig.yml

      - name: Deploy to Staging
        run: |
          kubectl set image deployment/$DEPLOYMENT_NAME $SERVICE_NAME=-n $NAMESPACE-staging
          kubectl rollout status deployment/$DEPLOYMENT_NAME -n $NAMESPACE-staging

      - name: Run Automated Tests
        run: |
          pytest tests/integration --env=staging --junitxml=report.xml

      - name: Approve Deployment to Production
        uses: mhmdio/workflow-dispatcher@v1
        with:
          webhook_url: ${{ secrets.SLACK_WEBHOOK_URL }}
          message: "Feature update for '$FEATURE_NAME' is ready for production. Manual approval required."
          options: approve, rollback

      - name: Deploy to Production (Manual Approval)
        if: github.event.inputs.approval == 'approve'
        run: |
          kubectl set image deployment/$DEPLOYMENT_NAME $SERVICE_NAME=-n $NAMESPACE
          kubectl rollout status deployment/$DEPLOYMENT_NAME -n $NAMESPACE

      - name: Set Feature Flag (Post-Deployment)
        if: github.event.inputs.approval == 'approve'
        run: |
          curl -X POST \
            -H "Authorization: Bearer $FEATURE_FLAG_API_KEY" \
            -d '{"feature":"$FEATURE_NAME","state":"enabled"}' \- name: Notify Rollback
        if: github.event.inputs.approval == 'rollback'
        run: |
          curl -X POST \
            -H "Authorization: Bearer $FEATURE_FLAG_API_KEY" \
            -d '{"feature":"$FEATURE_NAME","state":"disabled"}' \echo "Deployment for feature '$FEATURE_NAME' rolled back."

      - name: Notify Success on Slack
        if: success()
        uses: slackapi/slack-github-action@v1.23.0
        with:
          channel-id: "#zyna-deployments"
          text: "🚀 Feature update '$FEATURE_NAME' successfully deployed to production!"
          slack-token: ${{ secrets.SLACK_TOKEN }}
#ai #sol #agent #pumpfun