name: Build Institutional Trader
on: [push]

jobs:
  build-and-deploy:
    runs-on: ubuntu-latest
    env:
      DOCKER_HOST: tcp://172.17.0.1:2375
    steps:
      - name: Checkout
        uses: actions/checkout@v3

      - name: Build and push (Kaniko)
        run: |
          JOB_CONTAINER=$(docker ps --format '{{.Names}}' | grep 'GITEA-ACTIONS-TASK' | head -1)
          docker run --rm \
            --volumes-from "$JOB_CONTAINER" \
            gcr.io/kaniko-project/executor:latest \
              --context=dir://"$GITHUB_WORKSPACE" \
              --dockerfile="$GITHUB_WORKSPACE/Dockerfile" \
              --destination=192.168.8.250:5000/market:latest \
              --insecure \
              --skip-tls-verify
