stages:
  - build

before_script:
  - "git lfs install"
  - "git lfs pull"
  - "git submodule sync --recursive"
  - "git submodule update --init --recursive"

build:develop:
  stage: build
  only:
    - develop@log-gtav/reallife-gamemode
  script:
    - "dotnet restore"
    - "../gm_dev_database_password.sh"
    - "cd ReallifeGamemode.Server/"
    - "dotnet build -c Release"
    - "cd ../ReallifeGamemode.Client/"
    - "npm ci"
    - "npm run build:server"
    - "cd ../ReallifeGamemode.DataService"
    - "dotnet publish -c Release -r linux-x64"
    - "cd ../"
    - "sudo ../gm_dev_copy_build_files.sh"

build:master:
  stage: build
  only:
    - web
  script:
    - "dotnet restore"
    - "../gm_live_database_password.sh"
    - "cd ReallifeGamemode.Server/"
    - "dotnet build -c Release"
    - "cd ../ReallifeGamemode.Client/"
    - "npm ci"
    - "npm run build:server"
    - "cd ../ReallifeGamemode.DataService"
    - "dotnet publish -c Release -r linux-x64"
    - "cd ../"
    - "sudo ../gm_live_copy_build_files.sh"
