title: Execute Jenkins Pipeline step only when building a tag
body: <p>I have certain build logic, such as publication, that I would like to have Jenkins perform only when it is building a Git tag.  How can I accomplish this using Jenkin's Declarative Pipeline?</p>
  
  <p>In other words, I am trying to build functionality equivalent to Travis CI's deploy on tags functionality:</p>
  
  <pre class="lang-yaml prettyprint-override"><code>deploy:
    [...]
    on: 
      tags: true
  </code></pre>
  
  <p>There  is a <a href="https://jenkins.io/doc/book/pipeline/syntax/#built-in-conditions" rel="noreferrer">built-in condition to check the branch</a>, but I do not see one that indicates the tag. </p>