title: Is there a way to exclude a specific branch from gitlab AutoDevOps?
body: <p>I am trying to exclude a specific branch <code>production</code> from the gitlab pipeline in AutoDevOps, however I don't seen to be able to figure out the correct syntax.  Here is what I have:</p>
  
  <pre><code>build:
    stage: build
    image: docker:19.03.1
    variables:
      DOCKER_TLS_CERTDIR: ""
    services:
      - docker:19.03.8-dind
    before_script:
      - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
    script:
      - |
        if [[ -z "$CI_COMMIT_TAG" ]]; then
          export CI_APPLICATION_REPOSITORY=${CI_APPLICATION_REPOSITORY:-$CI_REGISTRY_IMAGE/$CI_COMMIT_REF_SLUG}
          export CI_APPLICATION_TAG=${CI_APPLICATION_TAG:-$CI_COMMIT_SHA}
        else
          export CI_APPLICATION_REPOSITORY=${CI_APPLICATION_REPOSITORY:-$CI_REGISTRY_IMAGE}
          export CI_APPLICATION_TAG=${CI_APPLICATION_TAG:-$CI_COMMIT_TAG}
        fi
      # make and git needed to run makefiles
      - apk add --update make
      - apk add --update git
      - make ci-build
      - make ensure_project publish_artifact
    rules:
      # don't build on production - that is just a marker branch in git
      - if: '$CI_COMMIT_BRANCH != "production"'
      - if: '$CI_COMMIT_TAG || $CI_COMMIT_BRANCH'
  </code></pre>
  
  <p>However, the pipeline still runs for <code>production</code>. What am I doing wrong?</p>