Skip to content

core:update telex webhook url #11

core:update telex webhook url

core:update telex webhook url #11

Workflow file for this run

name: CD Pipeline
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Notify Telex - Deployment Started
run: |
curl -X POST -H "Content-Type: application/json" -d '{
"event_name": "cd_pipeline",
"username": "GitHub Actions",
"status": "in_progress",
"message": "🚀 Deployment started for commit ${{ github.sha }}."
}' ${{ secrets.TELEX_WEBHOOK_URL }}
- name: Setup SSH Key
run: |
mkdir -p ~/.ssh
echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/ec2_key.pem
chmod 600 ~/.ssh/ec2_key.pem
- name: Deploy to EC2
run: |
ssh -o StrictHostKeyChecking=no -i ~/.ssh/ec2_key.pem ec2-user@${{ secrets.SSH_HOST }} << 'EOF'
cd /home/ec2-user/interval-custom-integration-task-prioritization
git pull origin main
source venv/bin/activate
pip install -r requirements.txt
sudo systemctl restart fastapi
EOF
- name: Notify Telex - Deployment Successful
if: success()
run: |
curl -X POST -H "Content-Type: application/json" -d '{
"event_name": "cd_pipeline",
"username": "GitHub Actions",
"status": "success",
"message": "✅ Deployment successful for commit ${{ github.sha }}."
}' ${{ secrets.TELEX_WEBHOOK_URL }}
- name: Notify Telex - Deployment Failed
if: failure()
run: |
curl -X POST -H "Content-Type: application/json" -d '{
"event_name": "cd_pipeline",
"username": "GitHub Actions",
"status": "failure",
"message": "❌ Deployment failed for commit ${{ github.sha }}."
}' ${{ secrets.TELEX_WEBHOOK_URL }}