title: How to execute gitlab-ci jobs on specific events
body: <p>I'm learning gitlab-ci and I'm having a difficult time setting up the .yml file to run a specific job only when a certain trigger token is used or when a branch is merged into master.</p>
  
  <p>I've read through gitlab-ci docs and reviewed several examples. Still, I'm not seeing what I'm looking for.</p>
  
  <p>*Edit: Answering part of my own question, using <code>only: - master</code> should only run the job for merges and pushes to master branch. </p>
  
  <pre><code>.build_template: &amp;base_defs
    stage: build_base
    &lt;&lt;: *tags_defs
    variables:
      FILE_VER: "3.4"
    script:
      - docker build -t "${DEV_BASE}:latest" "${VERSION}/devel/base"
        --build-arg FILE_VERSION=${FILE_VER}
    only:
      - master
      - ~ WHEN TRIGGER TOKEN MATCHES = K3K3K3K3 ~
  </code></pre>