Deployment

Deployment configuration

Conditional deployment

By default, deployment only occurs to master or application specific branch To have deployments on multiple branches per deployment provider/script, ensure that conditional deployment is properly configured

Basic condition is

deploy:
  - provider: some_provider
    # deployment providers and stuff here
    on:
      branch: master # master deployment
  - provider: another_provider
    # other stuffs
    on:
      branch: develop # develop deployment

To have all multiples branches, use the all_branches conditions restricted by other conditions.

deploy:
  # ...
  on:
    all_branches: true
    condition: some_condition_here

Deployment providers

Github pages

Travis provides support for Github pages deployment. Configuration is dead simple:

deploy:
  # Github pages provider
  provider: pages
  # Keep built artifacts
  skip-cleanup: true
  # Encrypted or secured environment variable
  github-token: $GITHUB_TOKEN
  # Not using git push --force
  keep-history: true
  # restricted branch
  on:
    branch: master

Sources: