diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 00793cf..ae15631 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -70,7 +70,7 @@ jobs: docker stop ci-test || true docker rm ci-test || true docker run -d --name ci-test \ - --network host \ + -p 0:80 \ -e APP_ENV=ci \ -e APP_VERSION=ci-${{ gitea.sha }} \ -e BUILD_DATE=$(date -u +"%Y-%m-%dT%H:%M:%SZ") \ @@ -78,8 +78,9 @@ jobs: -e GIT_BRANCH=${{ gitea.ref_name }} \ -e DEPLOY_TIME=$(date -u +"%Y-%m-%dT%H:%M:%SZ") \ ci-image:latest + CI_PORT=$(docker port ci-test 80 | cut -d: -f2) for i in $(seq 1 12); do - if curl -sf http://localhost:80/health > /dev/null 2>&1; then + if curl -sf http://localhost:$CI_PORT/health > /dev/null 2>&1; then echo "::notice::Health check passed" docker logs ci-test 2>&1 || true docker stop ci-test