Go down with the ship

To continue with a project or company right until the end (often in a failing situation).

My company may go bankrupt soon but I plan to stay and go down with the ship.