I'm not sure about in the US, I know in Canada we've had lots of university faculty positions advertised recently that are explicity for women or some other groups. I don't understand how it's legal but it is.
Some manage to find a workaround even when it's illegal. I was reading somewhere that Lund University in Sweden was cancelling the job opening right before the deadline if the most promising candidate wasn't a woman.
There's so much bullshit in this. Universities are not allowed to advertise positions as "women only", but at the same time they are required to reach certain percentage of female "representation" by law.
Many countries require being harmed by an action and then bringing that action before a court, before anyone ever compares that action to any specific law at all.
So you can see how many actions become de facto legal if nobody ever does that.
At least at my company, I know they have preferences for minorities over similarly qualified candidates. I've heard a department head specifically tell the managers that we need more women in a specific role. Maybe they're just breaking the law though...
This is one longish discussion of the differences between education and hiring. [1] I think there is a carveout for federal contractors, which is what your link refers to. In general, it is not legal in hiring.
I think there's an affirmative action lawsuit currently pending before SCOTUS. It seems discrimination is allowable (so far) as long as it has good intentions. It may change with this case.
Although there could be some discrepancy with a colloquial use of discrimination which includes an implied notion of negative bias, while positive biases (preferences to certain candidates) can also fit the more dry definition.
(for you who downmodded me, this saying is how management gets away with illegal discrimination without saying the quiet part out loud)