Deployment as a stage vs deployment as a phase

is there any difference between the below two ??

    - 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

    - 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

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. 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:

1 Like