name:  EpicMorg EcoSystem FreeGPT Images

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

jobs:

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

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

    steps:
    - uses: actions/checkout@v3
    - 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 freegpt-webui 1.0
      run:  cd linux/ecosystem/freegpt-webui/1.0 && make build && make deploy

    - name: Build and Deploy freegpt-webui 1.1
      run:  cd linux/ecosystem/freegpt-webui/1.1 && make build && make deploy
      
    - name: Build and Deploy freegpt-webui 1.2
      run:  cd linux/ecosystem/freegpt-webui/1.2 && make build && make deploy
      
    - name: Build and Deploy freegpt-webui 1.3
      run:  cd linux/ecosystem/freegpt-webui/1.3 && make build && make deploy
      
    - name: Build and Deploy freegpt-webui 1.3.1
      run:  cd linux/ecosystem/freegpt-webui/1.3.1 && make build && make deploy
      
    - name: Build and Deploy freegpt-webui 1.3.2
      run:  cd linux/ecosystem/freegpt-webui/1.3.2 && make build && make deploy
      
    - name: Build and Deploy freegpt-webui 1.4
      run:  cd linux/ecosystem/freegpt-webui/1.4 && make build && make deploy
      
    - name: Build and Deploy freegpt-webui latest
      run:  cd linux/ecosystem/freegpt-webui/latest && make build && make deploy

##################################################################################
    - name: Cleanup
      run: make docker-clean