Execute docs tasks before finalize build
diff --git a/build.gradle b/build.gradle
index e9a935e..a1226c1 100644
--- a/build.gradle
+++ b/build.gradle
@@ -310,3 +310,7 @@
     }
 }
 
+tasks.named("build").configure {
+    finalizedBy("groovydoc")
+}
+
diff --git a/settings.gradle b/settings.gradle
index 2b26050..72dfb3e 100644
--- a/settings.gradle
+++ b/settings.gradle
@@ -6,7 +6,7 @@
 gradleEnterprise {
     server = 'https://ge.grails.org'
     buildScan {
-        publishAlways()
+        publishAlwaysIf(System.getenv('CI') == 'true')
         publishIfAuthenticated()
         uploadInBackground = System.getenv("CI") == null
         capture {