diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 2c6d8be4f8adc00901d27d74028a1feb1be53287..a77a9a086a39cad313d31c4ab7a6772ba2606b13 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -67,18 +67,19 @@ deploy:
   stage: deploy
   script:
     - !reference [.workspace, script]
-    - git clone https://user:$OHOS_AGGREGATED_DOCS_TOKEN@git.ostc-eu.org/OSTC/infrastructure/openharmony-readthedocs-aggregated.git
-    - cd openharmony-readthedocs-aggregated
-    - git checkout origin/main # only main for now - needs to match the rules
-    - find . -maxdepth 1 -not -path ./.git -not -path . -exec rm -rf {} \;
-    - tar -c --dereference -C .. --exclude openharmony-readthedocs-aggregated --exclude ./.repo --exclude ./.git --exclude ./.gitlab-ci.yml . | tar -x
+    # We are in the root of the git-repo workspace.
+    - git clone https://user:$OHOS_AGGREGATED_DOCS_TOKEN@git.ostc-eu.org/OSTC/infrastructure/openharmony-readthedocs-aggregated.git aggregated
+    - (cd aggregated && git checkout origin/main) # only main for now - needs to match the rules
+    - (cd aggregated && find . -maxdepth 1 -not -path ./.git -not -path . -exec rm -rf {} \;)
+    - tar -c --dereference -C docs --exclude --exclude ./.git --exclude ./.gitlab-ci.yml . | tar -x -C aggregated
     # Commit and push back, if something changed.
     - |
+      cd aggregated;
       if [ -n "$(git status -s)" ]; then
         msg="docs repository snapshot - $CI_COMMIT_BRANCH:$CI_COMMIT_SHA";
         git config --local user.name "OpenHarmony CI";
         git config --local user.email "ci@ostc-eu.org";
-        git add -A
+        git add -A;
         git commit -sm "$msg";
         git push origin HEAD:main;
       else