CopyDocs: limit archiving doc artifacts

The artifacts from doc job were needed as a part of nightly artifacts
because https://www.trustedfirmware.org/ have pointed to nightly job for
documentation.

The CI has a doc nightly job for doc only "tf-m-build-docs-nightly"
which has updated as new link for documentation on tf.org.
As the copy docs consume a lot of time and disk space without any
purpose, so, remove the copy for nightly job.

But, the per patch job(tf-m-build-and-test) need the doc copy, because
of unmerged changes may affect the documentation build.

Signed-off-by: Karl Zhang <karl.zhang@arm.com>
Change-Id: I2c30ee237d07627bb5b656cc6dfa142003c7006f
diff --git a/jenkins/ci.jpl b/jenkins/ci.jpl
index ccf4a18..338b6b8 100644
--- a/jenkins/ci.jpl
+++ b/jenkins/ci.jpl
@@ -305,10 +305,15 @@
 
 node("docker-amd64-bionic") {
   stage("Copy Docs") {
-    step([$class: 'CopyArtifact', projectName: 'tf-m-build-docs',
-    selector: specific("${results['docs'][0]}"), target: './docs/',
-    optional: true])
-    archiveArtifacts artifacts: 'docs/**', allowEmptyArchive: true
+    if (env.JOB_NAME.equals("tf-m-build-and-test")) {
+      step([$class: 'CopyArtifact', projectName: 'tf-m-build-docs',
+      selector: specific("${results['docs'][0]}"), target: './docs/',
+      optional: true])
+      archiveArtifacts artifacts: 'docs/**', allowEmptyArchive: true
+    }
+    else {
+      print("No doc copy for job: ${env.JOB_NAME}")
+    }
   }
   stage("Tests") {
     dir("tf-m-ci-scripts") {