refactor environment checkout out of deploy step