Files
ci_cd_email_templates/README.md
T
2026-03-26 14:55:12 -05:00

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_NAME when 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.html
  • build/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:

  1. builds the production container image with Podman
  2. runs the renderer to produce HTML files
  3. uploads the generated templates to a Cloudflare R2 bucket

Required GitHub secrets:

  • CF_R2_ACCESS_KEY_ID
  • CF_R2_SECRET_ACCESS_KEY
  • CF_R2_ACCOUNT_ID
  • CF_R2_BUCKET

Optional GitHub variable:

  • CF_R2_PREFIX