diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..19eef27 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,34 @@ +name: test + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - name: prepare .env + run: cp env.sample .env + - name: Build the Docker image + run: docker compose up -d + - name: Wait for HTTP 200 response + run: | + max=30 + i=0 + echo "Waiting for localhost to respond with status code 200..." + until curl --insecure --head --fail https://localhost:7007; do + i=$((i+1)) + if [ "$i" -ge "$max" ]; then + echo "Max retries reached. Exiting." + exit 1 + echo "($i/$max)Waiting for https://localhost:7007 to return HTTP 200..." + sleep 5 + done + echo "RHDH is ready!"