You have to distinguish between a capital improvement and repairs. Repairs are not deductible but the cost of a capital improvement is added to your cost basis.
The IRS defines a capital improvement as something that makes a permanent structural change or restores some aspect of a property that will either enhance the property's overall value, increase its useful life, or adapt it to new uses. To qualify as capital improvements, such alterations must have a life expectancy of more than one year when the owner makes them. I assume this wasn’t a rental property.