I would like to show that if $i:A\to X$ is a cofibration and $f:A\to B$ is a homotopy equivalence, then the induced map $k:X\to X\cup_AB$ is again a homotopy equivalence. $\require{AMScd}$ $$ \begin{CD} A @>i>> X \\ @VfVV @VVkV \\ B @>>> X\cup_AB \end{CD} $$ What I have done: Choose a homotopy inverse of $f$, say $g$, and choose a homotopy $H:\mathrm{id}_{A}\simeq g\circ f$. Apply the HEP to $i\circ H:A\times I\to X$ and $\mathrm{id}_{X}:X\to X$ to obtain a homotopy $\tilde H:\mathrm{id}_{X}\simeq \tilde H_1$. Then $\tilde H_1:X\to X$ and $i\circ g:B\to X$ are compatible with the pushout, so they induce a map $\ell:X\cup_A B\to X$. I would like show to that $\ell$ is the inverse to $k$. Certainly $\ell\circ k\simeq\mathrm{id}_{X}$ via $H$, but I can't show the other direction $k\circ\ell\simeq\mathrm{id}_{X\cup_AB}$.
Note: this question was asked here, but the answer was just a list of references. I would really like an explicit proof. Any help would be appreciated. Thanks in advance!