Render Go templates to produce text output. Use for generating configuration files, reports, or any text content from templates and variables.
| Parameter | Type | Required | Description |
|---|
func | string | yes | Must be render |
args.template | string | yes | Path to a template file, or inline template string |
args.output | string | no | File path to write rendered output |
args.data | map | no | Additional data passed to the template context |
| Field | Type | Description |
|---|
result.output | string | The rendered text content |
Render uses Go templates with Sprig functions. All workflow variables, step outputs, and environment variables are available in the template context.
| Expression | Description |
|---|
{{ vars.key }} | Access workflow variable |
{{ steps.name.field }} | Access step output |
{{ env.VAR }} | Access environment variable |
{{ .data.key }} | Access data passed via args.data |
environment: {{ vars.env }}
version: {{ vars.version }}
config: "{{ result.output }}"
- name: render_deploy_manifest
template: "templates/deployment.yml.tmpl"
output: "generated/deployment.yml"
version: "{{ vars.version }}"
replicas: "{{ vars.replicas }}"
timestamp: "{{ now | date \"2006-01-02T15:04:05Z07:00\" }}"
do: kubectl apply -f {{ vars.manifest }}
deploy_result: "{{ result.output }}"
template: "state.yml.tmpl"
output: "{{ vars.state_repo }}/deployed/{{ vars.env }}.yml"
version: "{{ vars.version }}"
timestamp: "{{ now | date \"2006-01-02T15:04:05Z07:00\" }}"
status: "{{ steps.deploy_app.deploy_result }}"
Date: {{ now | date "2006-01-02" }}
Environment: {{ vars.env }}
Version: {{ vars.version }}
Build ID: {{ steps.build.build_id }}
Status: {{ steps.deploy.exit_code | eq 0 | ternary "SUCCESS" "FAILED" }}
report: "{{ result.output }}"
Service: {{ vars.service_name | upper }}
Config Map: {{ vars.service_name }}-config
Class Name: {{ vars.service_name | camelcase | title }}
Env Var: {{ vars.service_name | snakecase | upper }}_PORT