One way whether an action is godliness or religion is by the heart attitude that produced it. Christ told Israel that the scribes and Pharisees did their works to be seen of men. The works of the scribes and Pharisees were not wrong, but done with the wrong attitude , and therefore meaningless. Paul says we walk by faith. The only justification for good works is a heart that is responding in faith to the truth of God's Word.
Any act performed for any other reason is a dead religious work.
Only a heart of faith can produce godliness. The second way to evaluate any action is related to the first. True godliness must be based on the instruction found in God's Word and not on the teachings of men. If thou put the brethren in remembrance of these things, thou shalt be a good minister of Jesus Christ, nourished up in the words of faith and of good doctrine, whereunto thou hast attained. But refuse profane and old wives' fables, and exercise thyself rather unto godliness.