# Deployment as a stage vs deployment as a phase

**URL:** https://travis-ci.community/t/deployment-as-a-stage-vs-deployment-as-a-phase/8537
**Category:** Deployment
**Tags:** build-stages, build-phases
**Created:** [May 9, 2020, 11:45pm UTC](https://travis-ci.community/t/deployment-as-a-stage-vs-deployment-as-a-phase/8537 "2020-05-09T23:45:45Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![gondar00](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/gondar00/32/4568_2.png) [@gondar00](https://travis-ci.community/u/gondar00)
#### Post date: [May 9, 2020, 11:45pm UTC](https://travis-ci.community/t/deployment-as-a-stage-vs-deployment-as-a-phase/8537/1 "2020-05-09T23:45:45Z")

</div>

## is there any difference between the below two ??

```auto
    - stage: production
      name: "Deploy to Production"
      script: skip
      deploy:
        - provider: script
          script: bash config/deploy/production.sh
          skip_cleanup: true
          on:
            branch: current_release

```

and

```auto
    - stage: production
      name: "Deploy to Production"
      script: bash config/deploy/production.sh
      skip_cleanup: true
          on:
            branch: current_release

```

My question is can i use the deploy script directly in the stage since the provider is a script??

I am trying to re-factor an existing file and want to be sure that this way is fine

---

<div class="post-metadata">

### Author: ![native-api](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/native-api/32/430_2.png) [@native-api](https://travis-ci.community/u/native-api)
#### Post date: [May 10, 2020, 7:13pm UTC](https://travis-ci.community/t/deployment-as-a-stage-vs-deployment-as-a-phase/8537/2 "2020-05-10T19:13:38Z")

</div>

> [@gondar00](#):
>
> can i use the deploy script directly in the stage since the provider is a script?

Yes, you can, but then you’ll need to somehow transfer build artifacts into the machine running the dedicated deployment job – e.g. via a [workspace](https://docs.travis-ci.com/user/using-workspaces). In most cases, this is unnecessary complication.

`skip_cleanup:` is invalid outside of a `deploy:` entry and will be ignored in the 2nd example.

* * *

Check this for an overview of Travis’ build process:

> **[Travis CI Documentation](https://docs.travis-ci.com/user/job-lifecycle/)**
>
> Job Lifecycle
