Synthesize GitHub workflows from configured stacks and constructs.
dotgithub synth [options]The synth command generates actual GitHub workflow files (.yml) from your TypeScript code and construct configurations. This is the final step that converts your abstract workflow definitions into concrete GitHub Actions workflows.
--dry-run- Preview files without writing them to disk--build- Runnpm run buildbefore synthesis--output <dir>- Output directory (default: config outputDir relative to config file)--stack <name>- Synthesize only the specified stack--verbose- Show detailed output
dotgithub synthGenerates all configured workflows to the default output directory.
dotgithub synth --dry-runShows what would be generated without writing files.
dotgithub synth --output ./workflowsGenerates workflows to a custom directory.
dotgithub synth --buildRuns npm run build before generating workflows.
dotgithub synth --stack ciOnly generates workflows for the "ci" stack.
dotgithub synth --verboseShows detailed information about construct execution and file generation.
- Loads configuration - Reads
dotgithub.jsonand validates settings - Loads constructs - Imports and initializes configured constructs
- Executes stacks - Runs each stack's constructs to generate workflow content
- Writes files - Outputs the generated
.ymlfiles to the target directory - Reports results - Shows summary of generated files and any errors
Generated workflows are organized as:
.github/
├── workflows/
│ ├── ci.yml
│ ├── deploy.yml
│ └── release.yml
└── dotgithub.json
Each stack in your configuration:
- Loads its configured constructs
- Validates construct configurations
- Executes each construct's
synthesizemethod - Collects generated workflow files
- Writes files to the output directory
Constructs generate workflows by:
- Creating
WorkflowConstructinstances - Adding jobs with
JobConstruct - Using type-safe action wrappers
- Defining triggers and conditions
Example construct synthesis:
async synthesize(stack: GitHubStack): Promise<void> {
const wf = new WorkflowConstruct(stack, 'ci', {
name: 'CI Workflow',
on: { push: { branches: ['main'] } },
jobs: {}
});
new JobConstruct(wf, 'test', {
'runs-on': 'ubuntu-latest',
steps: [
checkout('Checkout').toStep(),
setupNode('Setup Node').toStep(),
run('Test', 'npm test')
]
});
}Use --dry-run to:
- Preview generated files without writing
- Validate your configuration
- Debug construct issues
- See file structure before committing
Dry run output shows:
- Files that would be written
- File contents (truncated)
- Construct execution results
- Any errors or warnings
The command will fail if:
- Configuration file is invalid
- Constructs fail to load
- Construct synthesis errors occur
- Output directory cannot be created
- File write permissions are insufficient
Synthesis performance depends on:
- Number of configured stacks
- Construct complexity
- Network operations (if any)
- File I/O operations
Use --stack to synthesize only specific stacks for faster iteration.
- Use dry run first - Always preview changes with
--dry-run - Incremental development - Use
--stackfor focused testing - Version control - Commit generated workflows to your repository
- CI integration - Run synthesis in your CI pipeline
- Construct testing - Test constructs individually before combining
- dotgithub init - Initialize a new project
- dotgithub construct - Manage constructs and stacks
- Construct Development Guide - Creating custom constructs
- Configuration Guide - Understanding dotgithub.json