Is $\mathrm{Spec}(\mathcal{B}/\mathcal{I}) \longrightarrow \mathrm{Spec}\mathcal{B}$ a closed immersion?

Let $S$ be a scheme, $\mathcal{B}$ be a $\mathcal{O}_S$-algebra and $\mathcal{I}$ be a quasi-coherent ideal of $\mathcal{B}$. Let $$i : Y_0 = \mathrm{Spec}(\mathcal{B}/\mathcal{I}) \longrightarrow Y = \mathrm{Spec}\mathcal{B}$$ be the morphism of $S$-schemes associated to the canonical morphism $\pi : \mathcal{B} \longrightarrow \mathcal{B}/\mathcal{I}$. Is $i$ a closed immersion? What is $i^\sharp : \mathcal{O}_Y \longrightarrow i_*\mathcal{O}_{Y_0}$ ?

Yes, by the same logic that $\operatorname{Spec} A/I\to \operatorname{Spec}A$ is a closed immersion. This is just the version over an arbitrary base.