Skip to content

Commit

Permalink
added changes to docker check inn workflow as recommended
Browse files Browse the repository at this point in the history
  • Loading branch information
VanshikaSabharwal committed Nov 8, 2024
1 parent 7d04c94 commit f8389f6
Showing 1 changed file with 6 additions and 21 deletions.
27 changes: 6 additions & 21 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -272,27 +272,12 @@ jobs:
run: |
docker run -d --name talawa-admin-app-container -p 8080:8080 talawa-admin-app
- name: Check if Talawa Admin App is running
run: |
timeout=60
while ! nc -z localhost 8080 && [ $timeout -gt 0 ]; do
sleep 1
timeout=$((timeout-1))
done

if [ $timeout -eq 0 ]; then
echo "Timeout waiting for application to start"
exit 1
fi

# Retry curl up to 3 times with 5s delay
for i in {1..3}; do
if curl --fail --silent http://localhost:8080/index.html; then
exit 0
fi
sleep 5
done
exit 1
- name: Check if Talawa Admin app starts in Docker
runs-on: ubuntu-latest
needs: [Code-Quality-Checks]
steps:
- name: Checkout the Repository
uses: actions/checkout@v4

- name: Stop Docker Container
if: always()
Expand Down

0 comments on commit f8389f6

Please sign in to comment.