Flies are attracted to smells from a very long distance. Make sure there is nothing on, near, or hiding under the deck to which they're attracted.
Does the cat kill birds and leave the bodies under the deck? Or maybe just do his business under there? ;)
Of course the food we have out attracts flies. They love sweet stuff. So there's no way around that part.
So the second part of the equation is to make sure there's nothing in the area to allow them to breed. Manure, rotting garbage, dead critters, etc., give their maggots something to grow in. If there's a constant nearby source of new flies, they'll be everywhere. Police the areas you control to eliminate those maggot factories.
Pay special attention to maggot farms that are downwind from the deck if the breeze is slow enough that the flies can fight the wind to follow the scent of your food on the deck. Higher winds are actually your friend when it comes to flies. :)
When you can't control the maggot factories in the area, at least find out where they are. Set up fly traps between your deck and the sources of the flies to intercept them and attract them away from the deck.
You need traps that attract the flies more powerfully than anything on or near the deck.
Just plain fly paper or fly strips work fairly well.
Electric bug zappers work at night, but they also kill beneficial bugs. Again, you want the zapper between you and the source of flies, not right there on the deck where it attracts them to you.
We tried bags of water at a local gun range that is near a municipal landfill, and saw no effect. Just too many flies from too much maggot breeding material nearby.
We're still working on that problem.
Tabbed in.