default:
  tags:
    - website

stages:
  - build
  - deploy

build:
  stage: build
  artifacts:
    paths:
      - build/
  script:
    - echo "Build"
    - npm install
    - npm run build

deploy-beta:
  stage: deploy
  script:
    - echo "Deploy to beta server"
    - ncftpput -R -u "$ftp_user" -p "$ftp_pass" pls5618.com beta_site build/*
  environment:
    name: beta
    url: http://beta.pls5618.com
  only:
    - beta

deploy:
  stage: deploy
  script:
    - echo "Deploy to server"
    - ncftpput -R -u "$ftp_user" -p "$ftp_pass" pls5618.com /public_html build/*
  environment:
    name: website
    url: http://pls5618.com
  only:
    - main
