From c5fb7128c181cd52f1c7b6271086c0c95b30a11d Mon Sep 17 00:00:00 2001 From: Dan Allen Date: Mon, 27 Nov 2017 19:26:53 -0700 Subject: [PATCH] configure CI job to publish preview site to GitLab Pages - change output folder for preview site to public (requirement of GitLab Pages) - add the public folder to .gitignore file - add job to CI build that publishes preview site from master branch - add link to preview site to the README --- .gitignore | 1 + .gitlab-ci.yml | 19 ++++++++++++++++--- README.adoc | 3 +++ gulpfile.js | 2 +- 4 files changed, 21 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 34b23da..57834a1 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ /build/ /node_modules/ +/public/ diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index a78f2f8..7fdb96b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -2,15 +2,16 @@ image: node:8 stages: - setup - verify +- deploy yarn: stage: setup - script: - - npm install -g yarn - - yarn --cache-folder=.yarn-cache cache: paths: - node_modules/ - .yarn-cache/ + script: + - npm install -g yarn + - yarn --cache-folder=.yarn-cache lint: stage: verify cache: @@ -18,3 +19,15 @@ lint: paths: - node_modules/ script: node_modules/.bin/gulp lint +pages: + stage: deploy + only: + - master + cache: + policy: pull + paths: + - node_modules/ + script: node_modules/.bin/gulp build:preview + artifacts: + paths: + - public diff --git a/README.adoc b/README.adoc index 3672aac..783e45b 100644 --- a/README.adoc +++ b/README.adoc @@ -1,6 +1,7 @@ = Antora Default UI // Project URIs: :uri-project: https://gitlab.com/antora/antora-ui-default +:uri-preview: https://antora.gitlab.io/antora-ui-default :uri-ci-pipelines: {uri-project}/pipelines :img-ci-status: {uri-project}/badges/master/pipeline.svg @@ -8,6 +9,8 @@ image:{img-ci-status}[CI Status (GitLab CI), link={uri-ci-pipelines}] This project is an archetype that demonstrates how to produce a UI bundle for use in an Antora-based documentation pipeline. +You can preview the default UI at {uri-preview}. + == Copyright and License Copyright (C) 2017 OpenDevise Inc. and the Antora Project. diff --git a/gulpfile.js b/gulpfile.js index 18dbbad..8f1635f 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -14,7 +14,7 @@ const preview = require('./tasks/preview') const bundleName = 'ui' const buildDir = 'build' const previewSiteSrcDir = 'preview-site-src' -const previewSiteDestDir = path.join(buildDir, 'preview-site') +const previewSiteDestDir = 'public' const srcDir = 'src' const destDir = path.join(previewSiteDestDir, '_') -- 2.11.0