GitHub Actions Integration
The Cased Deploy Notification Action is a one-line drop-in solution that automatically sends deployment events from your GitHub Actions workflows to Cased, enabling comprehensive monitoring and analysis of your deployments.
The Cased Deploy Notification Action integrates seamlessly with your existing GitHub Actions workflows, providing automatic deployment tracking without requiring complex configuration or external dependencies.
Features
- One-line drop-in: Just add the action to your workflow - no complex setup required
- Automatic context: Automatically fills repository and commit details from GitHub context
- Flexible metadata: Accepts custom JSON metadata and external URLs
- Zero dependencies: Simple HTTPS call to Cased with no external dependencies
- Comprehensive tracking: Links deployments to CI jobs and commit information
Quick Start
Add the Cased Deploy Notification Action to any GitHub Actions workflow:
name: Deployon: workflow_dispatch: push: branches: [ main ]
jobs: deploy: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4
# Your build & deploy steps here
- name: Notify Cased uses: cased/cased-deploy-notification-action@v1 with: api_key: ${{ secrets.CASED_API_KEY }} event_metadata: '{"environment": "prod"}'
Configuration
Required Parameters
Parameter | Description |
---|---|
api_key | Your Cased organization API key (store in GitHub secrets) |
Optional Parameters
Parameter | Default | Description |
---|---|---|
deployment_request | auto-generated | Friendly description of the deployment |
repository_full_name | ${{ github.repository }} | Repository to attribute deployment to |
status | success | Deployment status: pending , running , success , failure , cancelled |
event_metadata | - | JSON string with custom metadata (environment, version, etc.) |
commit_sha | ${{ github.sha }} | Commit being deployed |
commit_message | - | Commit message for the deployment |
external_url | - | Link back to the deployment job or run |
cased_base_url | https://app.cased.com | Alternate base URL (rarely needed) |
Advanced Examples
Multi-Environment Deployment
name: Deploy to Multiple Environmentson: workflow_dispatch: inputs: environment: description: 'Environment to deploy to' required: true type: choice options: ['staging', 'production']
jobs: deploy: runs-on: ubuntu-latest environment: ${{ inputs.environment }} steps: - uses: actions/checkout@v4
# Deploy steps here
- name: Notify Cased uses: cased/cased-deploy-notification-action@v1 with: api_key: ${{ secrets.CASED_API_KEY }} deployment_request: "Deploy ${{ github.sha }} to ${{ inputs.environment }}" event_metadata: | { "environment": "${{ inputs.environment }}", "version": "${{ github.ref_name }}", "deployer": "${{ github.actor }}" } external_url: "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
Conditional Deployment Notifications
name: Conditional Deploy Notificationon: push: branches: [ main, develop ]
jobs: deploy: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4
# Deploy steps here
- name: Notify Cased (Production) if: github.ref == 'refs/heads/main' uses: cased/cased-deploy-notification-action@v1 with: api_key: ${{ secrets.CASED_API_KEY }} event_metadata: '{"environment": "production"}'
- name: Notify Cased (Staging) if: github.ref == 'refs/heads/develop' uses: cased/cased-deploy-notification-action@v1 with: api_key: ${{ secrets.CASED_API_KEY }} event_metadata: '{"environment": "staging"}'
Deployment Status Tracking
name: Deploy with Status Trackingon: workflow_dispatch:
jobs: deploy: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4
- name: Notify Deployment Started uses: cased/cased-deploy-notification-action@v1 with: api_key: ${{ secrets.CASED_API_KEY }} status: "running" deployment_request: "Starting deployment of ${{ github.sha }}" event_metadata: '{"environment": "production", "phase": "start"}'
# Your deployment steps here
- name: Notify Deployment Success if: success() uses: cased/cased-deploy-notification-action@v1 with: api_key: ${{ secrets.CASED_API_KEY }} status: "success" deployment_request: "Successfully deployed ${{ github.sha }}" event_metadata: '{"environment": "production", "phase": "complete"}'
- name: Notify Deployment Failure if: failure() uses: cased/cased-deploy-notification-action@v1 with: api_key: ${{ secrets.CASED_API_KEY }} status: "failure" deployment_request: "Failed to deploy ${{ github.sha }}" event_metadata: '{"environment": "production", "phase": "failed"}'
API Key Setup
- Generate API Key: Go to your Cased organization settings → API Keys
- Add to GitHub Secrets: In your repository, go to Settings → Secrets and variables → Actions
- Create Secret: Add a new secret named
CASED_API_KEY
with your API key value
How It Works
The action runs a lightweight Python container that sends a POST request to Cased’s deployment API:
POST /api/v1/deployments/Authorization: Token <api_key>
The payload includes all the deployment information, and Cased automatically:
- Records the deployment event
- Triggers monitoring and notifications
- Links the deployment to your repository and commit
- Starts post-deployment health checks
Integration Benefits
Deployment Tracking
- Complete History: Track all deployments across environments
- Commit Correlation: Link deployments to specific commits and changes
- Environment Visibility: See deployment status across all environments
Monitoring Integration
- Automatic Monitoring: Cased automatically starts monitoring after deployment notifications
- Performance Tracking: Monitor application performance post-deployment
- Issue Detection: Detect anomalies and issues related to deployments
Team Collaboration
- Slack Notifications: Automatic notifications to team channels
- Deployment Dashboards: Visual deployment tracking in Mission Control
- Audit Trail: Complete audit trail of who deployed what and when
Best Practices
- Use Secrets: Always store your API key in GitHub secrets, never in code
- Meaningful Metadata: Include relevant information like environment, version, and deployer
- Status Tracking: Use different statuses to track deployment lifecycle
- External URLs: Link back to GitHub Actions runs for easy debugging
- Consistent Naming: Use consistent deployment request naming across workflows
Troubleshooting
Common Issues
Action fails with authentication error
- Verify your API key is correct and stored in GitHub secrets
- Check that the secret name matches what you’re using in the workflow
Deployment not showing in Cased
- Ensure the API key has proper permissions
- Check the repository name matches your Cased project configuration
Missing deployment details
- Verify the
event_metadata
is valid JSON - Check that required parameters are properly set
For more advanced deployment automation, see our Automated Deployments use case documentation.
The Cased Deploy Notification Action provides seamless integration between your GitHub Actions workflows and Cased’s comprehensive deployment monitoring and management platform.