This depends on your insurance policy and your reason for getting a new roof.
If your roof replacement is due to a severe weather event such as strong wind or large hail, then your homeowner’s insurance might be able to cover most of the cost. You will still be responsible for paying your policy’s deductible. Failure to do so is an act of fraud and is illegal.
However, if you want to replace your roof to increase your home’s resale value, or simply because of the property’s age, your homeowner’s insurance policy likely won’t help with the cost. In this case, you would be responsible for the entire total.