And if so, how did he and international communists who supported the USSR reconcile that (and the ethnic deportations) with anti-racist communist ideology?
First, it's worth saying that it's difficult to establish whether Stalin was 'personally a racist'. That said, he pursued a lot of policies that were detrimental to non-Russians throughout the course of his rule of the USSR. These included crackdowns on publishing and schooling in minority languages, failure to act to relieve famines that disproportionately burdened Ukraine and Kazakhstan, indeed even efforts to intensify said famines by refusing to allow the importation of food to affected regions, purges targeted at particular ethnic groups (Poles and Jews perhaps most prominently), and population transfers of practically every minority in the USSR at various times to Siberia and Central Asia.
To speak specifically to his anti-semitism, after WWII, Stalin cracked down rather hard on Jews throughout the Soviet Union, likely in response to the establishment of the state of Israel and the growth of zionism in the late 40s. Soviet propaganda began to announce a "struggle with cosmopolitanism" and to denounce "rootless cosmopolitans" (i.e. Jews). Although those particular phrases ran their official course pretty quickly, Soviet museums relating to Jewish history and culture were closed. It's quite possible that this was as much a manifestation of anti-Semitism as of Stalin's rather negative attitude towards non-Russian and non-Soviet identities after he came to power.
However, shortly before the end of his life, Stalin became quite overtly anti-Semitic. The Night of Murdered (lit. 'executed') Poets (August 12, 1952) saw 13 Soviet Yiddish writers killed on Stalin's orders. Later that year Stalin denounced "Jewish nationalists" as agents of the US, and Jews were removed from positions of power throughout the USSR. This process culminated in the "Doctors' Plot", which resulted in the arrest of hundreds of Jewish doctors who had been supposedly conspiring since the mid-1940s to kill off top Soviet leaders. As the plot grew in scope and the number of conspirators grew in size, Soviet media and propaganda drew more and more on anti-semitic tropes of Jews as saboteurs and swindlers. Stalin eventually hit on a plan to transfer the USSR's Jews to Siberia or Central Asia. Given that he had previously ordered some 3.3 million people of various non-Russian ethnicities deported to the center of the USSR, it's pretty safe to assume that this would have happened had Stalin not died.