“I’m an eldritch knight and I have extra attack; when I cast a cantrip like green flame blade, so I attack again, too?”
Honestly, I see this question come up weekly, and the answer is always the same:
There’s a difference between the Attack action, and an attack.
The Attack action is the most basic and obvious way you can attack on your turn. Anyone can do it, regardless of special abilities or class features. It’s just something you can do.
There are lots of situations where you might make an attack other than the Attack action. As part of an opportunity attack, for instance, or a bonus action off-hand attack because you’re fighting with two weapons, or because your battlemaster buddy used Commander’s Strike.
But if you’re casting a spell, such as Greenflame Blade, then you are taking the Cast a Spell action. This action may involve making an attack, it may not, but even if it does, it is not the Attack action.
What Extra Attack does is allow you to attack additional times (usually once, sometimes more) when you take the Attack action on your turn. It does not grant “extra attacks” in any other context or situation.
Possibly WotC could have come up with a different name for the Attack action, seeing as “attacks” are something you can do at other times, but alas, here we are.
* Note that eldritch knights of a certain level (specifically, 7th level or higher) have the War Magic class feature, which allows them to make a weapon attack as a bonus action after casting a cantrip, in a manner similar to two-weapon fighting. Which is to say, you can only do this when you cast a cantrip (presumably with the Cast a Spell action), and you can only do it afterward.