When you play spy these are the steps you take:
1) you get +1 card, +1 action
2) each player (including you) reveals the top card of his deck
3) You decide if that player (including yourself) keeps that card or discards it
That concludes your action playing spy. Now, since spy gave you +1 action, you can keep playing more action cards
As far as bridge/upgrade goes, you decide the order that you want to play your action cards. If you play bridge first, there is nothing that gives you +1 actions, so you have finished playing actions and move on to your buy phase. Now, if you had played mining village before you would be able to play more action cards after bridge.
So, say you have bridge, upgrade, mining village, and two coppers in your hand. If you
1) play bridge first, you resolve the action for bridge and you cannot play any more actions. Go on to buy phase without playing upgrade or mining village
2) play upgrade first, you get +1 card +1 action and must trash a card from your hand. you may keep playing actions after this if you wish.
3) play mining village first, you resolve mining village by getting your +1 card +2 actions and deciding (after you draw the card) if you want to trash mining village for +2 coin. Now, if you play bridge you will still be able to play upgrade after it since you have the additional actions from mining village (regardless of whether you trash it or not). Be careful with bridge and upgrade together though, once you play bridge it stays in effect throughout the rest of your turn. So if you upgrade a copper you must gain a card costing exactly one more than it and now estates, secret chambers, and other 2 cost cards only have a value of 1, so you would have to gain it.