Files
Pygentic-AI/.github/workflows/komodo-deploy.yml
Francis Secada ad1454ff3f
Some checks failed
Bandit / bandit (push) Has been cancelled
Docker Image CI / build (3.13) (push) Has been cancelled
Production Deployment Readiness
 Local build verified successfully
 Environment variables complete  
 CI/CD workflows updated
 Build process simplified (source copy vs git clone)
 All production-readiness fixes applied

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-02 19:11:03 -05:00

43 lines
1.6 KiB
YAML

name: Komodo Deployment Trigger
on:
workflow_run:
workflows: ["Docker Image CI"]
types:
- completed
branches: [ "**_deploy", "main" ]
jobs:
trigger_komodo_deployment:
runs-on: ubuntu-latest
# Only run if the 'Docker Image CI' workflow was successful
if: github.event.workflow_run.conclusion == 'success'
steps:
- name: Extract branch name from triggering workflow
id: branch
run: echo "BRANCH_NAME=$(echo ${{ github.event.workflow_run.head_branch }} | sed 's/\//-/g')" >> $GITHUB_OUTPUT
- name: Trigger Komodo Stack Deployment
env:
# The webhook URL is constructed from secrets
KOMODO_WEBHOOK_URL: "https://${{ secrets.KOMODO_HOST }}/listener/github/stack/${{ secrets.KOMODO_STACK_ID_OR_NAME }}/deploy"
run: |
# Get the branch name from the previous step's output
branch_name="${{ steps.branch.outputs.BRANCH_NAME }}"
# Construct a JSON payload containing the branch name
# This tells Komodo which specific branch/tag to deploy
payload=$(printf '{"ref":"%s"}' "$branch_name")
# Generate the signature based on the payload
signature=$(echo -n "$payload" | openssl dgst -sha256 -hmac "${{ secrets.KOMODO_WEBHOOK_SECRET }}" | sed 's/^.* //')
# Send the request to the Komodo webhook with the payload
echo "Triggering Pygentic-AI deployment for branch: $branch_name"
curl -X POST \
-H "Content-Type: application/json" \
-H "X-Hub-Signature-256: sha256=$signature" \
-d "$payload" \
--fail-with-body \
"${KOMODO_WEBHOOK_URL}"