How to start Travis CI deploy only when tag name matches a regex

Answer #1 95.6 %

Simplest way would still be with bash, this example will deploy only if tag name matches the regex "release.*":

    tags: true
    all_branches: true
    condition: "$TRAVIS_TAG =~ ^release.*$"

Check out this link for more info on travis environment variables: http://docs.travis-ci.com/user/ci-environment/#Environment-variables

Answer #2 100 %

eshizari's answer didn't work for me. This is the approach that I'm using instead:

  all_branches: true
  condition: $TRAVIS_TAG =~ ^v[0-9]+\.[0-9]+\.[0-9]+

You’ll also like:

© 2023 CodeForDev.com -