From 2ea2a6ffe3ce1be08b5c2fa8ce534859bfbaee75 Mon Sep 17 00:00:00 2001 From: gregoiredx Date: Fri, 18 Oct 2019 22:46:00 +0200 Subject: [PATCH 1/3] use gitlab CI env variable for project name --- docs/guide/deployment.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/guide/deployment.md b/docs/guide/deployment.md index cbf32e1efe..dad041e3bd 100644 --- a/docs/guide/deployment.md +++ b/docs/guide/deployment.md @@ -145,7 +145,7 @@ Typically, your static website will be hosted on https://yourUserName.gitlab.io/ module.exports = { publicPath: process.env.NODE_ENV === 'production' - ? '/yourProjectName/' + ? '/' + process.env.CI_PROJECT_NAME + '/' : '/' } ``` From c9cc06f7f72712ca768dee370de0c7d3520355f5 Mon Sep 17 00:00:00 2001 From: gregoiredx Date: Sat, 26 Oct 2019 11:13:59 +0200 Subject: [PATCH 2/3] add explanation on CI_PROJECT_NAME env var --- docs/guide/deployment.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/guide/deployment.md b/docs/guide/deployment.md index dad041e3bd..b6ac662da3 100644 --- a/docs/guide/deployment.md +++ b/docs/guide/deployment.md @@ -137,11 +137,11 @@ pages: # the job must be named pages - master ``` -Typically, your static website will be hosted on https://yourUserName.gitlab.io/yourProjectName, so you will also want to create an initial `vue.config.js` file to [update the `BASE_URL`](https://github.com/vuejs/vue-cli/tree/dev/docs/config#baseurl) value to match: +Typically, your static website will be hosted on https://yourUserName.gitlab.io/yourProjectName, so you will also want to create an initial `vue.config.js` file to [update the `BASE_URL`](https://github.com/vuejs/vue-cli/tree/dev/docs/config#baseurl) value to match your project name (the [`CI_PROJECT_NAME` environment variable](https://docs.gitlab.com/ee/ci/variables/predefined_variables.html) contains this value): + ```javascript // vue.config.js file to be place in the root of your repository -// make sure you update `yourProjectName` with the name of your GitLab project module.exports = { publicPath: process.env.NODE_ENV === 'production' From a458b65a5c9b3a390d24841f9357eb164c58ffa4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Deveaux?= Date: Wed, 6 Nov 2019 21:29:08 +0100 Subject: [PATCH 3/3] docs: gzip support in GitLab Pages --- docs/guide/deployment.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/guide/deployment.md b/docs/guide/deployment.md index b6ac662da3..be568a1a04 100644 --- a/docs/guide/deployment.md +++ b/docs/guide/deployment.md @@ -130,6 +130,8 @@ pages: # the job must be named pages - npm run build - mv public public-vue # GitLab Pages hooks on the public folder - mv dist public # rename the dist folder (result of npm run build) + # optionally, you can activate gzip support wih the following line: + - find public -type f -regex '.*\.\(htm\|html\|txt\|text\|js\|css\)$' -exec gzip -f -k {} \; artifacts: paths: - public # artifact path must be /public for GitLab Pages to pick it up