More phases, prevent deploy on TEST_ONLY

### New phases:
- before_prepare
- before_test
- before_deploy

### Bugfix
deploy scripts no longer run on a TEST_ONLY job.