Create test.yml #8
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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!" |