My IRA has a mixture of deductible and non-deductible contributions. I want to sell off some positions that I bought. Normally I would not need to pay capital gains tax, but if the positions were bought with non-deductible contributions would I need to pay capital gains tax?
No, transactions within the IRA do not have any immediate tax consequences. That is, you don't need to pay any tax on those capital gains within the IRA or have to worry about which part is attributable to deductible contributions and which to nondeductible contributions. You pay tax only when you take a distribution from the IRA, which is treated as a cash distribution even if the IRA custodian distributed stock or mutual fund shares to you: the value of the shares as of the close of business that day is how much cash you got. Each distribution from a nonRoth IRA is considered to be partly a return of your nondeductible contributions (which are nontaxable) and partly a withdrawal of the rest of the money (on which you have paid no tax as yet). The taxable portion of the distribution is taxed as ordinary income is taxed, with none of the special treatment given to long-term capital gains or qualified dividends etc., that is, the capital gains that happened within the IRA stay within the IRA and are irrelevant to your tax situation: it's all cash going in and cash coming out.
Dilip's answer is correct: it does not have any tax consequences of the nature you're referring to. You only pay tax when you withdraw from an IRA.
The primary difference before retirement of "Deductible IRA" and "Non-Deductible IRA" is solely whether you are able to deduct the initial contribution on your income taxes. Once the money's in the IRA, there's no difference until retirement. That's the point of an IRA - that it shields you from the capital gains taxes, and defers those taxes until retirement, so you can save for retirement without paying taxes on the savings right then (which for many people would make an IRA impossible - as for many, their IRA/401(k) accounts have substantially more money than they have in any other source).