image: eclipse-temurin:11

test:
  tags:
    - "cse391-hw5-linter-gitlab04"
  script:
    - javac *.java
    - java GenerateSite
    # heuristic to see if any lines were removed!
    - git fetch origin main
    - '(exit $(git diff origin/main HEAD | grep "^-[^-]" | wc -l)) || { echo "Malformed merge request: at least one line is removed in diff, or feature branch is not up-to-date with the main branch." && (exit 1) }'

pages:
  tags:
    - Pages
  only:
    - main
  script:
    - javac *.java
    - java GenerateSite
    - mkdir public
    - mv index.html public
    - mv assets public
    - mv fonts public
    - mv images public
    - mv products public
    - mv staff public
  artifacts:
    paths:
      - public
