I have never done it, but the obvious algorithm should be like this i think:
Precalculation:
For every vertex, find closest point on spline, and store that. A single float is enough to parametrize a spline.
To prevent visual discontinuities, it might be necessary to diffuse this parameter with neighboring vertices. Such artifacts would happen if the spline has a complex shape, so parametrized value jumps big steps between close vertices. To avoid this, you likely want to have a simple rest shape of the spline, no sharp corners or knots - more like a straight line, which then becomes curvy only at runtime with animation.
Optional: Calculate reference frame at the spline for each vertex and store local vertex coordinates in this frame, so you can have faster runtime skinning if needed.
Runtime (or the actual deformation):
For each vertex, calculate reference frame given our stored parametrization value on the spline, and transform the vertex.
Maybe this older post helps with reference frame math. It solves a different but similar problem. There are ofc. many ways to do this: https://www.gamedev.net/forums/topic/697215-extruding-a-shape-along-a-spline/
Usually the problem is how to model twisting around the spline itself, which is something you need to add on top because a spline alone does not define this well.