Move deploy logic into script