Flirting when one or both parties are taken can be fun and harmless when there's no follow through, and both parties are being honest about where their situation is heading. However, I'm concerned that he knows you like him, he's emotionally unavailable, and he may be toying with you. Only you know how far the flirting has gone.
You are attracted to someone whom you know is taken, but keep in mind that he is the one with the relationship commitment with the girlfriend. Has his flirting with you crossed a line between fun and emotionally betraying his girlfriend? If so, is this guy someone you would want to date? How would you feel if you were his in his girlfriend's shoes?
At some point, you're going to get tired of this flirting that is just empty teasing and toying. You may even want to tell him you're tired of just flirting with him and that if he were ever single, you'd date him, but right now he's acting like a player.