Ridix’ answer will work, but this might be easier to set up than a curve:
It’s just an altered cube that’s being modified by a circular array.
The Array Modifier is set to Object Offset and targeted at the Empty. Since the Empty is rotated 15° along Z it makes the array in 15° increments.
For a smoother animation you’ll need finer increments - and more so the more frames your animation takes to complete.
If you need this animation to be very smooth there is also a way to do this entirely with curves - a path curve (circular), a bevel curve (square), and a taper curve (animated), but the shading on the caps ends up looking pinched in my experience.
Actually, after considering this a little more, I think the best approach is to use a Curve Modifier, then use Shape Keys to control the scale. You may have to play around a bit to get the axes oriented correctly, but this method produces the best looking results. It will animate smoothly and with no shading issues.