aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpukkamustard <pukkamustard@posteo.net>2020-06-11 07:44:38 +0200
committerpukkamustard <pukkamustard@posteo.net>2020-06-11 07:44:38 +0200
commit70e7b1a6e1447b1c12df7b609fe5765445cccd5d (patch)
treeb69e21c57b46a417969b7b115c35a3e1647b336c
parente5f9fc2d38e757fec1f80c537cbad3a3c3ab6089 (diff)
build web-demo as GitLab pages
-rw-r--r--.gitignore1
-rw-r--r--.gitlab-ci.yml16
-rw-r--r--examples/web-demo/package.json2
3 files changed, 18 insertions, 1 deletions
diff --git a/.gitignore b/.gitignore
index 7cd53fd..e73ed4c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,2 @@
**/node_modules/
+/examples/web-demo/public/
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
new file mode 100644
index 0000000..9aac6cc
--- /dev/null
+++ b/.gitlab-ci.yml
@@ -0,0 +1,16 @@
+# GitLab CI to build the web-demo application
+image: node:latest
+
+pages:
+ cache:
+ paths:
+ - examples/web-demo/node_modules/
+ script:
+ - cd examples/web-demo
+ - npm install
+ - npm run build
+ artifacts:
+ paths:
+ - examples/web-demo/public
+ only:
+ - master
diff --git a/examples/web-demo/package.json b/examples/web-demo/package.json
index 24f507a..04da3ac 100644
--- a/examples/web-demo/package.json
+++ b/examples/web-demo/package.json
@@ -5,7 +5,7 @@
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
- "build": "npx -c 'browserify src/index.js -o index.js'",
+ "build": "mkdir -p public; cp index.html alice-in-wonderland.txt style.css public/; npx -c 'browserify src/index.js -o public/index.js'",
"watch": "npx -c 'watchify src/index.js -o index.js'"
},
"author": "pukkamustard",