RAW, the spell only ends Sanctuary in the moment you are casting the spell. When you cast Conjure Animals, you are not affecting an enemy creature (you are only Conjuring animals). If you then use the spell to affect an enemy creature, you are not casting the spell again, thus it does not end Sanctuary.
A similar case happens with Witch Bolt. See rules designer Jeremy Crawford's explanation here. Essentially, Witch Bolt keeps hitting after being cast. If you cast Sanctuary after casting Witch Bolt, Witch Bolt deals damage but doesn't end Sanctuary.1
Rules as Intended
It's unclear. From the same tweet above, Witch Bolt should end Sanctuary. Extrapolating this line of thinking, not only casting a spell to affect an enemy creature, but using it (e.g. issuing the command "Attack them" to your wolves) would end it as well. It's also arguable if issuing the command is the same as actually using your action to "recast" the spell, as in Witch Bolt.
So, if you are not running RAW, it's up to the DM how he sees Sanctuary working and what should end its effect or not. For example, Dragon's Breath also doesn't end it - even though it does something pretty against the usual conception of Sanctuary. 1
1 Both of these statements are not true any more due to November 2018 errata. Dealing damage now ends Sanctuary, thus Dragon's Breath, Breath Weapon from Dragonborns and other effects that had this loophole now end Sanctuary.
The errata does not change this answer, though.
Just for clarification, an errata for the PHB was released in November 2018. The text now states:
If the warded creature makes an attack, casts a spell that affects an enemy, or deals damage to another creature, this spell ends.
Note, however, that the warded creature, i.e. the one casting Conjure Animals, is not the one dealing damage to the other creature. The conjured animal is the creature dealing damage.