From 5a85ab966dc307f61d5458feb2e265f0f894ec78 Mon Sep 17 00:00:00 2001
From: "Eduardo L. Buratti" <elburatti@inf.ufpr.br>
Date: Wed, 31 Aug 2016 12:54:34 -0300
Subject: [PATCH] Add a task to build static documentation page (for GitLab
 Pages)

---
 .gitlab-ci.yml | 15 ++++++++++++++-
 package.json   |  4 +++-
 2 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 61357d69..5828d28b 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -2,9 +2,10 @@ image: node:6.2
 
 cache:
     paths:
-        - node_modules/
+        - /cache
 
 before_script:
+    - npm config set cache /cache
     - npm install --silent
     - node_modules/.bin/typings install
 
@@ -13,3 +14,15 @@ run_tests:
         - npm test
     tags:
         - node
+
+pages:
+    script:
+        - npm run doc-api
+        - cp -r doc public
+    tags:
+        - node
+    artifacts:
+        paths:
+            - public
+    only:
+        - master
diff --git a/package.json b/package.json
index 1ee3bdc6..aa23f5e7 100644
--- a/package.json
+++ b/package.json
@@ -7,7 +7,9 @@
     "postinstall": "typings install",
     "start": "node index",
     "pretest": "tslint -s node_modules/tslint-stylish -t stylish src/**/*.ts test/**/*.ts",
-    "test": "istanbul cover -x \"**/*.spec.ts\" -e .ts _mocha"
+    "test": "istanbul cover -x \"**/*.spec.ts\" -e .ts _mocha",
+    "show-coverage": "xdg-open coverage/lcov-report/index.html",
+    "doc-api": "raml2html -i specs/blendb-api-v1.raml -o doc/api-v1-reference.html"
   },
   "repository": {
     "type": "git",
-- 
GitLab