The Underground Railroad predated the Republican Party. I mean, sure, there was a couple years where some may have been, but for the most part, naah.
Also, there was a big chunk of the party, including Abraham Lincoln, that had no problem with maintaining slavery as long as it didn't spread to the Western Territories.
The Civil Rights Movement not only was mainly Democrat, it helped push Southerners into changing their party affiliation to Dixiecrat then Republican when that didn't work out. That's why it was a Democratic Party that had registration drives as well as partook in marches while the Republicans focused on joining the KKK.