Reusable GitHub Actions workflows for Docker Compose deployments across multiple repositories.
This repository provides centralized, reusable workflows for standardizing CI/CD processes across Docker Compose-based applications. The workflows eliminate code duplication while maintaining flexibility for environment-specific configurations.
- π Security First: Input validation, secret scanning, 1Password integration
- β‘ Performance Optimized: Parallel execution, caching, SSH multiplexing
- π Reliability: Retry logic, health checks, automatic rollback
- π Observability: Rich Discord notifications, detailed logging
- π§ͺ Testability: Local testing scripts, validation tools
Performs comprehensive validation of Docker Compose configurations with secret detection.
Features:
- Parallel Execution: All validation tasks run concurrently for speed
- GitGuardian Integration: Scans for leaked secrets (push events only)
- YAML Validation: Ensures proper formatting with yamllint
- Docker Compose Validation: Verifies syntax and configuration
- Matrix Strategy: Tests each stack independently
- Multi-Repository Support: Can validate any target repository
- Discord Notifications: Reports results with detailed status
Usage:
name: Lint Docker Compose
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
jobs:
lint:
uses: owine/compose-workflow/.github/workflows/lint.yml@main
secrets: inherit
with:
stacks: '["stack1", "stack2", "stack3"]'
webhook-url: "op://Docker/discord-github-notifications/webhook_url"
repo-name: "my-docker-repo"
target-repository: ${{ github.repository }}
target-ref: ${{ github.sha }}
github-event-before: ${{ github.event.before }}
github-event-base: ${{ github.event.base }}
github-pull-base-sha: ${{ github.event.pull_request.base.sha }}
github-default-branch: ${{ github.event.repository.default_branch }}
event-name: ${{ github.event_name }}Handles production deployments with comprehensive safety features and monitoring.
Features:
- Input Validation: Comprehensive security validation of all inputs
- Smart Deployment: Skip if already at target (unless forced)
- Retry Mechanisms: Exponential backoff for network operations
- Parallel Deployment: Deploy multiple stacks concurrently
- Health Checking: Stack-specific service monitoring
- Automatic Rollback: Revert on deployment failure
- SSH Optimization: Connection multiplexing for performance
- Tailscale Integration: Secure zero-trust networking
- Docker Cleanup: Remove unused images post-deployment
- Rich Notifications: Detailed Discord deployment reports
Usage:
name: Deploy Docker Compose
on:
workflow_run:
workflows: ["Lint Docker Compose"]
types: [completed]
branches: [main]
workflow_dispatch:
inputs:
force-deploy:
description: 'Force deployment even if already at target'
required: false
type: boolean
default: false
jobs:
deploy:
uses: owine/compose-workflow/.github/workflows/deploy.yml@main
secrets: inherit
with:
stacks: '["stack1", "stack2", "stack3"]'
webhook-url: "op://Docker/discord-github-notifications/webhook_url"
repo-name: "my-docker-repo"
target-ref: ${{ github.sha }}
has-dockge: true
force-deploy: ${{ inputs.force-deploy || false }}
args: "--detach --remove-orphans"Calling repositories must follow this structure:
βββ .yamllint # YAML linting configuration
βββ compose.env # Environment file with 1Password references
βββ stack1/
β βββ compose.yaml # Docker Compose file
βββ stack2/
β βββ compose.yaml # Docker Compose file
βββ stack3/
βββ compose.yaml # Docker Compose file
Configure these secrets in calling repositories:
OP_SERVICE_ACCOUNT_TOKEN- 1Password service account tokenSSH_USER- SSH username for deployment serverSSH_HOST- SSH hostname/IP for deployment server
Store sensitive data in 1Password with references like:
op://Vault/Item/field
op://Docker/discord-github-notifications/webhook_url
op://Docker/tailscale-oauth/client_id
op://Docker/gitguardian/api_key
The repository includes testing scripts in scripts/testing/:
# Test workflow input validation
./scripts/testing/test-workflow.sh
# Validate Docker Compose files
./scripts/testing/validate-compose.sh# Validate workflow syntax
actionlint .github/workflows/lint.yml
actionlint .github/workflows/deploy.yml
# Check YAML formatting
yamllint --strict .github/workflows/*.yml- All lint validations run concurrently
- Stack deployments execute in parallel
- Matrix strategy for independent operations
- Tailscale State: Cached per repository owner and run
- Deployment Tools: Version-based caching for reliability
- SSH Connections: Multiplexed for connection reuse
- SSH operations: 3 attempts with exponential backoff
- Health checks: 6 attempts with dynamic timing
- Deployment operations: Configurable timeouts
- Stack names validated for safe characters
- Target refs checked for proper format
- Webhook URLs verified as 1Password references
- Repository names sanitized
- Compose arguments filtered for dangerous patterns
- All secrets stored in 1Password
- Runtime secret loading only
- GitGuardian scanning prevents leaks
- Service account token isolation
- Tailscale zero-trust networking
- SSH key authentication only
- Connection multiplexing with ControlMaster
- Secure webhook communications
GitGuardian Failures
- Verify
OP_SERVICE_ACCOUNT_TOKENis set - Check 1Password vault access
- Ensure API key exists in vault
Deployment Connection Issues
- Verify SSH secrets are configured
- Check Tailscale OAuth credentials
- Ensure server is Tailscale-accessible
- Review SSH retry logs
Health Check Problems
- Verify stack-specific compose files (
-f compose.yaml) - Check service startup times
- Review container logs
- Adjust retry attempts/timing
Discord Notification Issues
- Verify webhook URL format in 1Password
- Check service account permissions
- Test webhook manually
Enable detailed logging in workflow calls:
env:
ACTIONS_STEP_DEBUG: true
ACTIONS_RUNNER_DEBUG: true- Latest: Use
@mainfor newest features - Stable: Pin to tags like
@v1.0.0 - Testing: Use branch references like
@feature-branch
- Test changes with
actionlintand local scripts - Update documentation (README.md, CLAUDE.md)
- Ensure backward compatibility
- Test across multiple repositories
- Create PR with detailed description
This repository is private and for internal use only.
For issues or questions:
- Check troubleshooting guide above
- Review workflow logs for detailed errors
- Contact repository maintainers
- Input Validation: Comprehensive security validation
- Retry Logic: Exponential backoff for reliability
- Health Checks: Stack-specific service counting
- Caching: Optimized for performance
- Parallel Execution: All validations run concurrently
- SSH Optimization: Connection multiplexing
- Testing Scripts: Local validation capabilities