name: Docker Compose Actions Workflow

on: workflow_dispatch

jobs:
  build:
    runs-on: ubuntu-20.04

    steps:
      - uses: actions/checkout@v2
      - name: Build the stack
        # run: docker-compose up # remove -d in order to see the build output in gh actions for debugging - you'll need to cancel the run manually once it's done
        run: docker-compose up -d
        env:
          DOCKER_BUILDKIT: 1
          COMPOSE_DOCKER_CLI_BUILD: 1
      - name: Test 127.0.0.1
        run: docker run --network container:claroline-web curlimages/curl -s  --connect-timeout 500 --max-time 1000 --retry 5000 --retry-delay 10 --retry-max-time 4000 --retry-all-errors http://127.0.0.1/
      - name: Test 172.22.9.6
        run: docker run --network container:claroline-web curlimages/curl -s  --connect-timeout 50 --max-time 100 --retry 50 --retry-delay 10 --retry-max-time 40 --retry-all-errors http://172.22.9.6/
