1.6 KiB
CI/CD Email Templates
TSX-based email templates for CI/CD pipeline success and failure notifications. The package renders minified HTML for both templates, writes them to disk, and emits the rendered templates on stdout as JSON for pipeline automation.
Placeholder
The application name placeholder is always {{APP_NAME}}.
Pipeline logic can either:
- replace
{{APP_NAME}}in the uploaded HTML before sending, or - set
APP_NAMEwhen running the renderer to emit app-specific HTML directly.
Local usage
Build the package:
npm install
npm run build
Render the templates:
npm start
By default this writes:
build/html/pipeline-success.htmlbuild/html/pipeline-failure.html
Override the application name or output directory with environment variables:
APP_NAME=my-service OUTPUT_DIR=./out npm start
Podman lifecycle
Build and run through podman-compose:
podman-compose up --build
The rendered HTML files are written to ./build/html on the host.
Override the rendered app name during compose runs:
APP_NAME=my-service podman-compose up --build
If APP_NAME is not set, the renderer falls back to {{APP_NAME}}.
GitHub Actions release
The workflow at .github/workflows/release.yml:
- builds the production container image with Podman
- runs the renderer to produce HTML files
- uploads the generated templates to a Cloudflare R2 bucket
Required GitHub secrets:
CF_R2_ACCESS_KEY_IDCF_R2_SECRET_ACCESS_KEYCF_R2_ACCOUNT_IDCF_R2_BUCKET
Optional GitHub variable:
CF_R2_PREFIX