Gitlab CI Setup manual trigger for feature branches

  • This pipeline only runs automatically on the default branch
  • Other branches requires a manual trigger once for the trigger job to start all remaining jobs
stages:
  - build

trigger:
  stage: .pre
  rules:
    # needs manual trigger to run subsequent pipeline
  - if: $CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH
    when: manual
  script:
    - echo "Building ..."
    - echo "Build complete."

build:
  stage: build
  script:
    - echo "Building ..."
    - echo "Build complete."