Neither the Greeks nor, as far as I'm aware, any of the ancient people had anything like racism as we know it today, which didn't stop neighbours killing each other from time to time, but they never did it based on colour of skin. You had to be a Hellene to contest the Olympics, but that's only because you needed to be a member of the club. Romans didn't get to join either (unless you were an Emperor capable of executing the Judges of the Games, in which case they might see things your way). In fact of all the other peoples of the word, the Greeks had an especial respect for the Egyptians, in cause of their ancient culture.
To the Greeks, if you came from Africa, then you were either an Egyptian, or an Aethiopian. Aethiopian was their catch-all term for an African.
You might be surprised to hear there were Africans in the Greek lands. Here's an example:
I'm afraid it's not very clear from my poor photography, but this exhibit from the British Museum shows a boy, almost certainly a slave, holding a boot, and the features are African. (The funny shape at his back is a bird). The odds are very good this boy was passed along in the slave markets until he found himself working in Athens.
For some reason I don't understand, the Aethiopians had been an enemy of Hellas stretching back to the Trojan War. The bards sang in the great epic Aethiopis that Memnon, the hero-king of Aethiopia, brought a contingent to fight for the Trojans. Memnon slew Antilochus and was such a warrior that no one could touch him until he was brought down by Achilles himself. Memnon's skill and courage was so great that Zeus granted him immortality. The Greeks had no problem with someone of dark skin being beloved of the Gods and a hero.
Unfortunately Aethiopis has been lost, but it's part of the Trojan cycle and if we had it, it would almost certainly put some of the Iliad in a different light.
More recently, Herodotus recorded that a band of Aethiopians fought for the Great King of Persia when he invaded Hellas. Here's a good example of that:
This is an Aethiopian warrior in the army of Xerxes. You can tell because he's wearing trousers, very much Persian dress. The vase is dated 460-440BC, twenty or so years after the invasion.