Update stage detection at deploy.rb