name:  EpicMorg EcoSystem Misc Images

on:
#  push:
#    branches:
#      - 'develop'
  schedule:
    - cron:  '0 0 * * 2,4,6'

jobs:

  build-torrserver-image:
    name: EpicMorg EcoSystem TorrServer Image
    runs-on: ubuntu-20.04

    steps:
    - uses: actions/checkout@v4
    - name: Log into registry
      run:  echo "${{ secrets.DOCKER_SERVER_KEY }}" | docker login -u "${{ secrets.DOCKER_SERVER_LOGIN }}" --password-stdin

    - name: Test Make
      run:  make

    - name: Build and Deploy TorrServer
      run:  cd linux/ecosystem/torrserver && make build && make deploy

##################################################################################

  build-ers-image:
    name: EpicMorg EcoSystem Electron Release Server Image
    runs-on: ubuntu-20.04

    steps:
    - uses: actions/checkout@v4
    - name: Log into registry
      run:  echo "${{ secrets.DOCKER_SERVER_KEY }}" | docker login -u "${{ secrets.DOCKER_SERVER_LOGIN }}" --password-stdin

    - name: Test Make
      run:  make

    - name: Build and Deploy Electron Release Server
      run:  cd linux/ecosystem/electron-release-server && make build && make deploy

##################################################################################

  build-vk2discord-image:
    name: EpicMorg EcoSystem vk2discord Image
    runs-on: ubuntu-20.04

    steps:
    - uses: actions/checkout@v4
    - name: Log into registry
      run:  echo "${{ secrets.DOCKER_SERVER_KEY }}" | docker login -u "${{ secrets.DOCKER_SERVER_LOGIN }}" --password-stdin

    - name: Test Make
      run:  make

    - name: Build and Deploy vk2discord
      run:  cd linux/ecosystem/vk2discord && make build && make deploy

##################################################################################

  build-qbittorrent-image:
    name: EpicMorg EcoSystem qBittorrent Image
    runs-on: ubuntu-20.04

    steps:
    - uses: actions/checkout@v4
    - name: Log into registry
      run:  echo "${{ secrets.DOCKER_SERVER_KEY }}" | docker login -u "${{ secrets.DOCKER_SERVER_LOGIN }}" --password-stdin

    - name: Test Make
      run:  make

    - name: Build and Deploy qBittorrent 4.4.0
      run:  cd linux/ecosystem/qbittorrent/4.4.0 && make build && make deploy

    - name: Build and Deploy qBittorrent 4.4.1
      run:  cd linux/ecosystem/qbittorrent/4.4.1 && make build && make deploy

    - name: Build and Deploy qBittorrent 4.4.2
      run:  cd linux/ecosystem/qbittorrent/4.4.2 && make build && make deploy

    - name: Build and Deploy qBittorrent 4.4.3.1
      run:  cd linux/ecosystem/qbittorrent/4.4.3.1 && make build && make deploy

##################################################################################

    - name: Cleanup
      run: make docker-clean

##################################################################################

    - name: Build and Deploy qBittorrent 4.4.4
      run:  cd linux/ecosystem/qbittorrent/4.4.4 && make build && make deploy

    - name: Build and Deploy qBittorrent 4.4.5
      run:  cd linux/ecosystem/qbittorrent/4.4.5 && make build && make deploy

    - name: Build and Deploy qBittorrent 4.5.0
      run:  cd linux/ecosystem/qbittorrent/4.5.0 && make build && make deploy

    - name: Build and Deploy qBittorrent 4.5.1
      run:  cd linux/ecosystem/qbittorrent/4.5.1 && make build && make deploy

##################################################################################

    - name: Cleanup
      run: make docker-clean

##################################################################################

    - name: Build and Deploy qBittorrent 4.5.2
      run:  cd linux/ecosystem/qbittorrent/4.5.2 && make build && make deploy

    - name: Build and Deploy qBittorrent 4.5.3
      run:  cd linux/ecosystem/qbittorrent/4.5.3 && make build && make deploy

    - name: Build and Deploy qBittorrent 4.5.4
      run:  cd linux/ecosystem/qbittorrent/4.5.4 && make build && make deploy

##################################################################################

    - name: Cleanup
      run: make docker-clean

##################################################################################

    - name: Build and Deploy qBittorrent 4.5.5
      run:  cd linux/ecosystem/qbittorrent/4.5.5 && make build && make deploy

    - name: Build and Deploy qBittorrent 4.6.0
      run:  cd linux/ecosystem/qbittorrent/4.6.0 && make build && make deploy

    - name: Build and Deploy qBittorrent 4.6.1
      run:  cd linux/ecosystem/qbittorrent/4.6.1 && make build && make deploy

##################################################################################

    - name: Cleanup
      run: make docker-clean

##################################################################################

    - name: Build and Deploy qBittorrent 4.6.2
      run:  cd linux/ecosystem/qbittorrent/4.6.2 && make build && make deploy

    - name: Build and Deploy qBittorrent 4.6.3
      run:  cd linux/ecosystem/qbittorrent/4.6.3 && make build && make deploy

    - name: Build and Deploy qBittorrent 4.6.4
      run:  cd linux/ecosystem/qbittorrent/4.6.4 && make build && make deploy

    - name: Build and Deploy qBittorrent Testing
      run:  cd linux/ecosystem/qbittorrent/testing && make build && make deploy

##################################################################################

  build-opentracker-image:
    name: EpicMorg EcoSystem openTracker Image
    runs-on: ubuntu-20.04

    steps:
    - uses: actions/checkout@v4
    - name: Log into registry
      run:  echo "${{ secrets.DOCKER_SERVER_KEY }}" | docker login -u "${{ secrets.DOCKER_SERVER_LOGIN }}" --password-stdin

    - name: Test Make
      run:  make

    - name: Build and Deploy openTracker
      run:  cd linux/ecosystem/opentracker && make build && make deploy

##################################################################################

  build-retracker-image:
    name: EpicMorg EcoSystem reTracker Image
    runs-on: ubuntu-20.04

    steps:
    - uses: actions/checkout@v4
    - name: Log into registry
      run:  echo "${{ secrets.DOCKER_SERVER_KEY }}" | docker login -u "${{ secrets.DOCKER_SERVER_LOGIN }}" --password-stdin

    - name: Test Make
      run:  make
# to rework
#    - name: Build and Deploy reTracker
#      run:  cd linux/ecosystem/retracker && make build && make deploy

##################################################################################

  build-torrust-tracker-image:
    name: EpicMorg EcoSystem Torrust Tracker Image
    runs-on: ubuntu-20.04

    steps:
    - uses: actions/checkout@v4
    - name: Log into registry
      run:  echo "${{ secrets.DOCKER_SERVER_KEY }}" | docker login -u "${{ secrets.DOCKER_SERVER_LOGIN }}" --password-stdin

    - name: Test Make
      run:  make

    - name: Build and Deploy Torrust Tracker
      run:  cd linux/ecosystem/torrust-tracker && make build && make deploy
# to rework
#    - name: Build and Deploy Torrust Index
#      run:  cd linux/ecosystem/torrust-index && make build && make deploy

##################################################################################

  build-monero-cli-image:
    name: EpicMorg EcoSystem Monero CLI Image
    runs-on: ubuntu-20.04

    steps:
    - uses: actions/checkout@v4
    - name: Log into registry
      run:  echo "${{ secrets.DOCKER_SERVER_KEY }}" | docker login -u "${{ secrets.DOCKER_SERVER_LOGIN }}" --password-stdin

    - name: Test Make
      run:  make

    - name: Build and Deploy Monero CLI
      run:  cd linux/ecosystem/monero/monerod && make build && make deploy

##################################################################################

  build-monero-p2pool-image:
    name: EpicMorg EcoSystem Monero p2pool Image
    runs-on: ubuntu-20.04

    steps:
    - uses: actions/checkout@v4
    - name: Log into registry
      run:  echo "${{ secrets.DOCKER_SERVER_KEY }}" | docker login -u "${{ secrets.DOCKER_SERVER_LOGIN }}" --password-stdin

    - name: Test Make
      run:  make

    - name: Build and Deploy Monero p2pool
      run:  cd linux/ecosystem/monero/p2pool && make build && make deploy

##################################################################################

  build-ninjam-image:
    name: EpicMorg EcoSystem ninjam Image
    runs-on: ubuntu-20.04

    steps:
    - uses: actions/checkout@v4
    - name: Log into registry
      run:  echo "${{ secrets.DOCKER_SERVER_KEY }}" | docker login -u "${{ secrets.DOCKER_SERVER_LOGIN }}" --password-stdin

    - name: Test Make
      run:  make

    - name: Build and Deploy ninjam
      run:  cd linux/ecosystem/ninjam/latest && make build && make deploy

##################################################################################

    - name: Cleanup
      run: make docker-clean