Optical network-on-chip (ONoC) architecture offers excellent communication performance for unconflicted messages. However, extra communication delays and energy overheads will be incurred by communication contention, significantly diminishing the benefits offered by ONoC. Thermal reliability is also a potential issue in ONoC designs due to the intrinsic thermal sensitivity of nanophotonic devices. In order to achieve communication optimization with guaranteed thermal reliability, we employ local thermal tuning at the device level to guarantee system reliability, and further propose two routing approaches that include a mixed-integer linear programming (MILP) based approach and a contention-aware routing (CAR) heuristic for the thermal-reliable ONoCs. By jointly considering communication conflict and the energy consumption caused by thermal tuning under chip thermal variations, our approaches can significantly improve communication performance with the minimized communication contention and reduce thermal-induced energy overhead, compared with state-of-the-art techniques.