---
kind: pipeline
type: docker
name: Run test build

platform:
  os: linux
  arch: amd64

steps:
  - name: Build JS/CSS
    image: node:current-slim
    commands:
      - npm ci --ignore-scripts
      - npm run build
  - name: Build
    image: debian:bookworm
    commands:
      - ln -snf /etc/localtime && echo CET > /etc/timezone
      - ./src/hst_autocompile.sh --dontinstalldeps --hestia --debug --cross --noinstall --keepbuild '~localsrc'
      - mkdir -p ./hestia/
      - mv /tmp/hestiacp-src/deb/*.deb ./hestia/

trigger:
  event: [push]

---
kind: pipeline
type: docker
name: Push to beta atp server

platform:
  os: linux
  arch: amd64

steps:
  - name: Build JS/CSS
    image: node:current-slim
    commands:
      - npm ci --ignore-scripts
      - npm run build
  - name: Build
    image: debian:bookworm
    commands:
      - ln -snf /etc/localtime && echo CET > /etc/timezone
      - ./src/hst_autocompile.sh --dontinstalldeps --hestia --debug --cross --noinstall --keepbuild '~localsrc'
      - mkdir -p ./hestia/
      - mv /tmp/hestiacp-src/deb/*.deb ./hestia/
  - name: Upload
    image: appleboy/drone-scp
    settings:
      host:
        from_secret: apt_server
      user: root
      key:
        from_secret: ssh_key
      port: 22
      command_timeout: 2m
      target: /root/
      source:
        - ./hestia/*

trigger:
  event: [promote]
