image: node:16.15.1-alpine3.16

stages:
  - test
  - deploy

test:
  stage: test
  script:
  - yarn install
  - yarn build
  rules:
    - if: $CI_COMMIT_REF_NAME != $CI_DEFAULT_BRANCH

pages:
  stage: deploy
  script:
  - yarn install
  - yarn build
  - mv ./build public
  artifacts:
    paths:
    - public
  rules:
    - if: $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH
