CI/CD Integration
Automate deployments with webhooks
CI/CD Integration
Automate your deployments by integrating Senate with your CI/CD pipeline using webhooks.
Overview
Senate supports automated deployments through Webhooks - trigger deployments via HTTP POST requests.
Setting Up Webhooks
GitHub Repository Webhook (Recommended)
The easiest way to set up CI/CD is using GitHub's built-in webhook feature:
Get the Webhook URL
- Go to Services → Select your service
- Click Settings tab
- Copy the Webhook URL

Configure GitHub
- In your GitHub repository, go to Settings → Webhooks
- Click Add webhook
- Paste the Senate webhook URL
- Set Content type to
application/json - Choose Just the push event or select specific events
- Click Add webhook

Now every push to your repository will automatically trigger a deployment.
Keep your webhook URL secret. Anyone with this URL can trigger deployments.
Webhook URL Format
Each service has a unique webhook URL:
https://senate.example.com/api/services/<service-id>/deploy?token=<secret-token>Manual Trigger
You can also trigger deployments manually via curl:
curl https://senate.example.com/api/services/<service-id>/deploy?token=<secret-token>Troubleshooting
Webhook not triggering
- Check webhook URL is correct
- Verify network connectivity (can GitHub reach your Senate instance?)
- Check Senate logs for errors
- Ensure webhook is enabled in service settings
Deployment stuck
- Check image can be pulled
- Verify container starts successfully
- Check health check isn't failing
- Review deployment logs in Senate dashboard
Advanced: GitHub Actions Workflows
For more control over your deployment pipeline (e.g., running tests, building images before deploy), you can use GitHub Actions workflows.
Basic Deployment
Create .github/workflows/deploy.yml:
name: Deploy to Senate
on:
push:
branches: [main]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Trigger deployment
run: |
curl ${{ secrets.SENATE_WEBHOOK_URL }}With Docker Build
Build and push image, then deploy:
name: Build and Deploy
on:
push:
branches: [main]
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v5
with:
push: true
tags: myuser/myapp:${{ github.sha }}
- name: Deploy to Senate
run: |
curl "${{ secrets.SENATE_WEBHOOK_URL }}Environment-Specific Deployments
Deploy to different environments based on branch:
name: Deploy
on:
push:
branches:
- main
- develop
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Deploy to staging
if: github.ref == 'refs/heads/develop'
run: curl ${{ secrets.SENATE_STAGING_WEBHOOK }}
- name: Deploy to production
if: github.ref == 'refs/heads/main'
run: curl ${{ secrets.SENATE_PROD_WEBHOOK }}Setting Up GitHub Secrets
- Go to your GitHub repo → Settings → Secrets and variables → Actions
- Click New repository secret
- Add
SENATE_WEBHOOK_URLwith your webhook URL
Manual Approval for Production
For production deployments requiring approval:
jobs:
deploy-prod:
runs-on: ubuntu-latest
environment: production # Requires approval
steps:
- run: curl ${{ secrets.SENATE_PROD_WEBHOOK }}Related
- Deployments - Deployment details
- Services - Service configuration
- First Deployment - Getting started