Noah had already "found grace" (Genesis 6:8), was "a preacher of righteousness" (2 Peter 2:5), and "walked with God" BEFORE he built the ark. His obedience was a DEMONSTRATION of his faith and not the origin of it. Building the ark demonstrated that Noah believed God about flooding the earth and the ark saved Noah and his family (physically) from drowning. (Hebrews 11:17) If Noah would have refused to build the ark, then he would have demonstrated a lack of faith in what God told him about flooding the earth, but of course, that was not the case.