Bring your own workflow
You can reuse the modules, backend, runner and governance from an existing pipeline, including one currently running on GitHub Actions. Adapt the execution logic into an Argo WorkflowTemplate and connect it through the IaCStack execution contract.
What you can change and what you must keep
| You own | The integration needs |
|---|---|
| Module, inputs, images, and stages. HTML reports, OPA, and approval forms are optional. | A registered Argo WorkflowTemplate selected by the stack. GitHub Actions YAML does not run directly. |
| Identity, target, backend, and state lock. | A consistent target binding and a single state writer. The pipeline and backend are responsible for those. |
| When to review plans, remediate drift, or block apply. | Intent and results in the execution contract format. If the alias requires authorization, request and claim it before apply. Human approval is separate. |
Want to see a change before migrating? Add a real step in Kind. For adopting existing state, follow the sequence below.
Connect an existing pipeline
- Identify where the old pipeline resolves source and target, plans, reviews and applies.
- Package the runner dependencies and the versioned
iacstackCLI. Alternatively, implement the transport defined in the execution contract. - Give the workflow a ServiceAccount for its target and state. Register its alias, template and contract settings in the controller. Select it with
spec.workflowRef.name. - Check target identity, backend binding, locking and state ownership. Disable writes from the old pipeline during the handoff.
- Run the first plan in a controlled environment. An adoption with identical configuration should report
NoChangesand preserve resource identities. Exercise a controlled input change before regular use.
Execution contract and CLI · Operations
Translate the pipeline, not its state
| Existing CI/CD concept | Argo / IaC Stack equivalent |
|---|---|
| Trigger, manual dispatch, pipeline inputs | IaCStack declaration, reconciliation and intent |
| Jobs and dependencies | WorkflowTemplate steps or DAG |
| Runner image and tools | Per-template script.image or container.image |
| Environment credentials | Workflow ServiceAccount, workload identity and secret references |
| Job outputs / uploaded plan | Argo parameters for small signals; protected artifacts for the saved plan |
| Manual approval or policy | Argo suspend and policy steps; controller authorization is separate |
| Pipeline result | CLI publishes a functional execution-result |
For example, migrate a GitHub Actions plan/apply job by extracting its shell logic to scripts in your runner or repository. Replace checkout/ref inputs with the validated intent and immutable revision. Preserve the backend configuration, provider lock file and tool versions. Use Argo artifacts or an appropriately scoped PVC to transport a saved plan and the required execution context between Pods. A fresh Pod does not inherit another Pod’s files or environment.
Wire the contract
- Read
INTENTandWORKFLOW; validate the requested source, operation, target and existing binding. - Resolve the immutable revision and backend/target binding, then publish
resolved-source. - Run plan with detailed exit codes (0 = no change, 2 = change, 1 = error). A no-change apply reports
NoChangeswithout mutating. Destroy must be verified and reportVerified, even if the target is already absent. - For an authorization-enabled integration, run policy/approval, publish the request from a completed step, verify the reviewed plan and binding in the mutation step, then claim before applying.
- Apply the saved plan and verify the outcome before reporting
Verified. A functional rejection reportsBlocked; a deliberate cancellation without mutation reportsCancelled. Operational errors fail the Argo step. Do not turn a failed apply into a successful result. - Map the output files to global Argo parameters and register the same names in Helm values.
See the CLI reference for concrete commands and the workflow lab for a complete registration example. For a split-stage implementation with artifacts, policy and approval, inspect the governed test fixture and the OPA governance tutorial. Test fixtures include development-only images and storage configuration; they are not production-ready drop-in manifests.
Cut over safely
- Test the adapted workflow with an isolated backend and least-privilege identity. Exercise no-change, change, rejection, failure, and destroy against disposable resources.
- Inventory the real state and backend key, credentials, Terraform/OpenTofu and provider versions. Back up state and record resource identities.
- Stop all old pipeline writers for that state and retain backend locking. Confirm that no other IaCStack manages the same state.
- Perform a controlled plan-only review or an approval-gated plan with no mutation permitted. Verify the binding, revision and expected diff. A nonempty plan needs investigation, not automatic application.
- Enable reconciliation only after the handoff is accepted; monitor status and logs. To roll back, stop new attempts and drain active executions before restoring the old writer. Do not run both systems concurrently against the same state.
Follow the GitHub Actions migration walkthrough and workspace transport guide. For a complete release-based WorkflowTemplate, see Build a pipeline from scratch.