diff --git a/.gitea/workflows/browser-e2e.yml b/.gitea/workflows/browser-e2e.yml index 040fb88..91a5e35 100644 --- a/.gitea/workflows/browser-e2e.yml +++ b/.gitea/workflows/browser-e2e.yml @@ -39,13 +39,18 @@ jobs: DEPLOY_HOST: ${{ secrets.DEPLOY_HOST }} run: | set -e - for i in $(seq 1 30); do - if curl -fsS "http://${DEPLOY_HOST}/taxbaik/healthz" >/dev/null; then + EXPECTED_VERSION="$(git rev-parse --short HEAD)" + for i in $(seq 1 60); do + VERSION_BODY="$(curl -fsS "http://${DEPLOY_HOST}/taxbaik/version.txt" || true)" + BLOG_STATUS="$(curl -s -o /dev/null -w '%{http_code}' "http://${DEPLOY_HOST}/taxbaik/blog/accountant-mistakes-5" || true)" + if echo "$VERSION_BODY" | grep -q "Version: ${EXPECTED_VERSION}" && [ "$BLOG_STATUS" = "200" ]; then + echo "Deployment is ready for ${EXPECTED_VERSION}" exit 0 fi + echo "Waiting for deployment ${EXPECTED_VERSION}; blog status=${BLOG_STATUS}; version=${VERSION_BODY}" sleep 10 done - echo "Deployment did not become healthy in time" >&2 + echo "Deployment did not publish expected version ${EXPECTED_VERSION} in time" >&2 exit 1 - name: Browser E2E verification