If you can, have a real estate attorney review you lease agreement and do some checking to be sure your lease will be in full force once the new owners take ownership
Sorry you are in this situation. It normally will take some time to sell an income property, such as a duplex, so I would not expect you will have to move right away. If you are concerned, why not look into something that is not going up for sale in the near future?
CA probably protects the tenant in this case, but I would check with an attorney to be safe.
You may get lucky, and the house will be bought by an investor who would be happy to have you stay well beyond the one-year lease. Or, the buyer might want to move in. But you will definitely have a year to deal with this. Good luck!