The spell will be cast
each time you cast a spell
it does not say "each time you attempt to cast" or anything similar. When a spell is cast, it is complete and its effects will take place.1
...but maybe not for long
If the caster dies from this damage, the effect on the spell will depend on which spell was cast.
Obviously any spell with a concentration requirement will cease to work. Anything that interacts with the spellcaster dying/dropping to 0hp/taking damage may take place depending on the wording.
However, a spell with a duration of instantaneous will take effect immediately (before the damage/death).
1 Unless some specific rule like the ready action supersedes this.