1.7 KiB
CI/CD Email Templates
TSX-based email templates for CI/CD pipeline success and failure notifications. The package renders Prettier-formatted HTML for both templates, writes it to disk, and emits readable HTML blocks on stdout 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:
pnpm install --frozen-lockfile
pnpm run build
Render the templates:
pnpm 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 pnpm 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
The release job targets the Production GitHub Actions environment.
Required Production environment secrets:
CF_R2_ACCESS_KEY_IDCF_R2_SECRET_ACCESS_KEYCF_R2_ACCOUNT_IDCF_R2_BUCKET
Optional Production environment variable:
CF_R2_PREFIX