GitHub Actions
Integrate Cased with GitHub Actions to automate your deployment workflow
Overview
Cased integrates with GitHub Actions to execute your deployments, providing:
- Consistent deployment processes across all environments
- Reuse of existing GitHub Actions workflows
- Full visibility into deployment execution
- Secure credential management
- Deployment approval flows
Setting Up GitHub Actions
1. Create Your Workflow
Create a GitHub Actions workflow in your repository (e.g.,
.github/workflows/deploy.yml
):
name: Deployon: workflow_dispatch: inputs: branch: description: "Branch to deploy" required: true target_name: description: "Target environment" required: true
jobs: deploy: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 with: ref: ${{ github.event.inputs.branch }}
# Add your deployment steps here - name: Deploy to environment run: | echo "Deploying ${{ github.event.inputs.branch }} to ${{ github.event.inputs.target_name }}"
2. Configure in Cased
- Navigate to your project settings
- Create a new deployment target
- Select the GitHub Actions workflow
- Configure target-specific settings:
send_branch
: Send branch name to workflowsend_target_name
: Send target environment name
How It Works
- Workflow Dispatch: When a deployment is triggered, Cased calls the GitHub Actions API to start your workflow
- Parameter Passing: Cased automatically passes:
- Branch or commit reference
- Target environment name
- Any additional configured inputs
- Status Tracking: Cased monitors the workflow execution and updates deployment status
- Log Collection: Deployment logs are collected and displayed in real-time
Advanced Features
Queue Management
ProCased automatically manages deployment queues:
- Prevents concurrent deployments to the same target
- Handles timeouts for stale deployments
- Supports custom queue settings per target
Branch Protection
Ensure deployment safety with:
- Required approvals before deployment
- Branch restrictions per environment
- Protected environment configurations
Workflow Variables
Control what information is passed to your workflow:
send_branch
: Toggle branch name passingsend_target_name
: Toggle target name passing- Support for custom workflow inputs
Best Practices
-
Workflow Design
- Keep workflows focused on deployment tasks
- Use reusable workflow components
- Include proper error handling
-
Security
- Use GitHub Secrets for sensitive data
- Implement proper approval flows
- Restrict workflow permissions appropriately
-
Monitoring
- Configure timeout settings
- Set up deployment notifications
- Monitor deployment health metrics
Troubleshooting
Common issues and solutions:
-
Workflow Not Starting
- Check GitHub Actions permissions
- Verify workflow file exists in the correct branch
- Ensure workflow_dispatch trigger is enabled
-
Failed Deployments
- Check workflow logs in GitHub Actions
- Verify input parameters are correct
- Ensure required secrets are configured
-
Stuck Deployments
- Check queue settings
- Verify workflow timeout configurations
- Look for concurrent deployment conflicts