This repository uses automated GitHub Actions workflows to handle testing, deployments, and release management.
| Workflow | Trigger | Purpose |
|---|---|---|
| test-deploy.yml | PR/Push | Lint, test, and deploy to environments |
| create-release-branch.yml | Manual | Create release branch from main |
| create-production-pr.yml | Manual | Create production release PR |
| cleanup-release-branch.yml | Production merge | Update release, cleanup branch |
| docker-images.yml | Docker changes | Build/publish Docker images |
File: create-release-branch.yml
Trigger: Manual (workflow_dispatch)
Purpose: Creates a release branch from main for UAT testing
Usage:
- Go to Actions → "Create Release Branch"
- Optionally check "Force update existing branch" if needed
- Click "Run workflow" (version will be auto-generated)
What it does:
- Creates/updates
releasebranch from latestmain - Generates changelog with recent commits
- Creates GitHub release draft with changelog
- Automatically triggers deployment to pre-prod environment
- Sends Slack notification (if configured)
File: reset-branch.yml
Trigger: Manual (workflow_dispatch)
Purpose: Reset a target branch to match a source branch (destructive operation)
Usage:
- Go to Actions → "Reset Branch"
- Select From branch (main or production)
- Select To branch (develop)
- Type "RESET" to confirm the destructive operation
- Click "Run workflow"
What it does:
- Validates the confirmation input
- Resets target branch to exactly match source branch
- Force pushes the updated branch
- Automatically triggers Test and Deploy workflow
- Sends Slack notifications for start/success/failure
File: create-production-pr.yml
Trigger: Manual (workflow_dispatch)
Purpose: Creates PR from release → production with comprehensive checklist
Usage:
- Go to Actions → "Create Production Release PR"
- Enter release notes
- Click "Run workflow"
What it does:
- Validates
releasebranch exists - Generates changelog from commits
- Creates PR with deployment checklist
- Assigns
@xwp/client-xteam as reviewers - Adds
production-releaselabel
File: cleanup-release-branch.yml
Trigger: Automatic (when production PR is merged)
Purpose: Cleans up after successful production deployment and syncs branches
What it does:
- Deletes release branch (if exists)
- Publishes GitHub release with cross-linking to production PR
- Sends completion notification
File: test-deploy.yml
Trigger: All PRs and pushes to protected branches
Lint and Test run as parallel jobs on separate runners, cutting wall-clock time roughly in half compared to serial execution. A lightweight Notify job sends a single consolidated Slack message after both complete. Deploy runs only on pushes to protected branches.
┌──────┐ ┌──────┐
│ Lint │ │ Test │ ← parallel
└──┬───┘ └──┬───┘
│ ┌─────┘
┌──▼───▼──────┐
│ Notify Slack │ ← consolidated result
├──────────────┤
│ Deploy │ ← protected branches only
└──────────────┘- ✅ Lint and Test (parallel)
- ❌ No deployment
- ✅ Lint and Test (parallel)
- ⏭️ Tests skipped for
release/production(already tested upstream) - 🚀 Deploy to environment:
develop→ Dev environmentmain→ Test environmentrelease→ Pre-prod environmentproduction→ Production environment
- Parallel jobs — Lint and Test run simultaneously on separate runners
- No Docker in Lint — Lint job skips Docker login/pull for faster setup
- Incremental PHPCS on PRs — only changed PHP files are checked; full scan on pushes to protected branches
- Consolidated Slack — single notification after both jobs complete
- Auto-cancellation of redundant runs
- NewRelic deployment markers (production only)
If branch protection rules reference the old "Lint and Test" check name, update them to require both "Lint" and "Test". The "Notify Slack" job should not be a required check.
File: docker-images.yml
Purpose: Builds and publishes Docker images when needed
- Docker-related file changes (builds only, doesn't publish)
- PR labeled with
docker-image-build(builds and publishes) - Manual workflow dispatch (builds and publishes)
- Make Docker changes (Dockerfile, docker-compose.yml)
- Push to PR
- Add
docker-image-buildlabel to PR - Images are built and published to GitHub Container Registry
- Only builds when actually needed (saves CI time)
- Explicit control over publishing
- Version immutability
DEPLOY_SSH_KEY # SSH key for VIP deploymentsSLACK_WEBHOOK_URL # Slack webhook for notifications
NEW_RELIC_API_KEY # NewRelic deployment markers📋 Slack setup guide: SLACK-NOTIFICATIONS.md
SLACK_CHANNEL # Slack channel (e.g., #releases)
GIT_USER_NAME # Git author name (default: XWP Deploy Bot)
GIT_USER_EMAIL # Git author email (default: technology@xwp.co)production-release # Added to production PRs
docker-image-build # Triggers Docker image publishingThe CODEOWNERS file automatically assigns reviewers:
- All files require review from
@xwp/client-xteam - Works with branch protection rules to enforce reviews
All workflows support optional Slack notifications. Examples and setup details: SLACK-NOTIFICATIONS.md
- Create feature branches from
main - Ensure tests pass before merging
- Use descriptive commit messages
- Add Docker label only when publishing images
- Use release workflows for UAT and production
- Review production PRs carefully
- Monitor Slack notifications for deployment status
- Verify environment deployments before promoting
- Configure secrets and variables in repository settings
- Set up branch protection rules
- Keep Docker images updated
Workflow fails with missing secrets:
- Check repository secrets are configured
- Verify secret names match workflow expectations
Docker builds fail:
- Ensure
docker-image-buildlabel is added to PR - Check Docker image versions in docker-compose.yml
Deployments fail:
- Verify SSH key has proper permissions
- Check VIP repository access
- Review deployment logs for specific errors
Slack notifications not working:
- Confirm both
SLACK_CHANNELandSLACK_WEBHOOK_URLare set - Test webhook URL manually
- Check channel permissions
- Check workflow logs in GitHub Actions tab
- Review error messages in PR checks
- Consult team Slack channels
- Contact EM/TL for infrastructure issues