Skip to content

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: Deploy
on:
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

  1. Navigate to your project settings
  2. Create a new deployment target
  3. Select the GitHub Actions workflow
  4. Configure target-specific settings:
    • send_branch: Send branch name to workflow
    • send_target_name: Send target environment name

How It Works

  1. Workflow Dispatch: When a deployment is triggered, Cased calls the GitHub Actions API to start your workflow
  2. Parameter Passing: Cased automatically passes:
    • Branch or commit reference
    • Target environment name
    • Any additional configured inputs
  3. Status Tracking: Cased monitors the workflow execution and updates deployment status
  4. Log Collection: Deployment logs are collected and displayed in real-time

Advanced Features

Queue Management

Pro

Cased 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 passing
  • send_target_name: Toggle target name passing
  • Support for custom workflow inputs

Best Practices

  1. Workflow Design

    • Keep workflows focused on deployment tasks
    • Use reusable workflow components
    • Include proper error handling
  2. Security

    • Use GitHub Secrets for sensitive data
    • Implement proper approval flows
    • Restrict workflow permissions appropriately
  3. Monitoring

    • Configure timeout settings
    • Set up deployment notifications
    • Monitor deployment health metrics

Troubleshooting

Common issues and solutions:

  1. Workflow Not Starting

    • Check GitHub Actions permissions
    • Verify workflow file exists in the correct branch
    • Ensure workflow_dispatch trigger is enabled
  2. Failed Deployments

    • Check workflow logs in GitHub Actions
    • Verify input parameters are correct
    • Ensure required secrets are configured
  3. Stuck Deployments

    • Check queue settings
    • Verify workflow timeout configurations
    • Look for concurrent deployment conflicts