stages:
  - update
  - start
  - jekyll_debug
  - stop
  - uninstall

update:
  stage: update
  tags:
    - tonyford
  only:
    refs:
      - master
      - main
    variables:
      - $CMD =~ /update|^$/
  before_script:
    - chmod +x ./setenv && . setenv
  script:
    - deploy/update

start:
  stage: start
  tags:
    - tonyford
  only:
    refs:
      - master
      - main
    variables:
      - $CMD =~ /start/
  before_script:
    - chmod +x ./setenv && . setenv
  script:
    - deploy/start

jekyll_debug:
  stage: jekyll_debug
  tags:
    - tonyford
  only:
    refs:
      - master
      - main
    variables:
      - $CMD =~ /jekyll_debug/
  before_script:
    - chmod +x ./setenv && . setenv
  script:
    - deploy/jekyll_debug

stop:
  stage: stop
  tags:
    - tonyford
  only:
    refs:
      - master
      - main
    variables:
      - $CMD =~ /^stop$/
  before_script:
    - chmod +x ./setenv && . setenv
  script:
    - deploy/stop

uninstall:
  stage: uninstall
  tags:
    - tonyford
  only:
    refs:
      - master
      - main
    variables:
      - $CMD =~ /^uninstall$/
  before_script:
    - chmod +x ./setenv && . setenv
  script:
    - deploy/uninstall
