diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index be659214e51d40ac4d51576b5f2233580baa714a..a7be807a8ce481aa5677fe6f152ebedbe2d4cc9c 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,13 +1,24 @@
 # This file is a template, and might need editing before it works on your project.
 # Full project: https://gitlab.com/pages/plain-html
+# pages:
+#   stage: deploy
+#   script:
+#   - mkdir .public
+#   - cp -r _book/* .public
+#   - mv .public public
+#   artifacts:
+#     paths:
+#     - public
+#   only:
+#   - master
+
+# the 'pages' job will deploy and build your site to the 'public' path
 pages:
   stage: deploy
   script:
-  - mkdir .public
-  - cp -r * .public
-  - mv .public public
+    - gitbook build . public # build to public path
   artifacts:
     paths:
-    - public
+      - public
   only:
-  - master
+    - master # this job will affect only the 'master' branch