Vladimir Starkov
Vladimir Starkov

Reputation: 19803

Can I trigger travis ci to build my app by creating git tag?

I want to trigger Travis CI to build and deploy when I create tag via github web interface. I can't find information about triggers for Travis CI. So can I do it?

Upvotes: 16

Views: 7580

Answers (1)

Odi
Odi

Reputation: 6916

A build should automatically start when a new tag is created. To deploy you have to add the follow bit to the deploy section:

on:
   tags: true

Here is a complete example:

language: php

php:
- 5.3
- 5.4

deploy:
  provider: heroku
  strategy: git
  skip_cleanup: true
  app: myapp
  on:
    tags: true
    php: '5.4'
  api_key:
    secure: NL10DAVFJJPk7mHdKeN3q5hpKgRq/gKpEnsXeBb7dDcnW0XuwmO88srMVbYHOA6w3kw50aPkKZ1AirElPjcpm2uxEz/tW7PpshY8fGDKdCyuczXKh24avTpD8nF8lskTIPXVpwWBYxCoFziRsd+eQBKHCsRyrQcv0mjg2j2MoNE=

Travis CI has a nice documentation about all the possibilities.

Upvotes: 13

Related Questions