Files
Nathan VasseandManuel Raynaud 6f9d213261 ♻️(ci) extract build-mails into a reusable workflow
The e2e tests in drive-frontend.yml need the compiled mail
templates. Rather than duplicating the build-mails job, we
extract it into a reusable workflow that both drive.yml and
drive-frontend.yml can call.
2026-02-06 16:02:25 +01:00

46 lines
1.2 KiB
YAML

name: Build mail templates reusable workflow
on:
workflow_call:
jobs:
build-mails:
runs-on: ubuntu-latest
defaults:
run:
working-directory: src/mail
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: "18"
- name: Restore the mail templates
uses: actions/cache@v4
id: mail-templates
with:
path: "src/backend/core/templates/mail"
key: mail-templates-${{ hashFiles('src/mail/mjml') }}
- name: Install yarn
if: steps.mail-templates.outputs.cache-hit != 'true'
run: npm install -g yarn
- name: Install node dependencies
if: steps.mail-templates.outputs.cache-hit != 'true'
run: yarn install --frozen-lockfile
- name: Build mails
if: steps.mail-templates.outputs.cache-hit != 'true'
run: yarn build
- name: Cache mail templates
if: steps.mail-templates.outputs.cache-hit != 'true'
uses: actions/cache@v4
with:
path: "src/backend/core/templates/mail"
key: mail-templates-${{ hashFiles('src/mail/mjml') }}