From 7232677f8c86d9fdb347ab33a92d3f300dd607f9 Mon Sep 17 00:00:00 2001 From: Shinigami Date: Mon, 9 Aug 2021 07:20:04 +0200 Subject: [PATCH] chore(docs): improve gitlab pages deployment (#4534) --- docs/guide/static-deploy.md | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/docs/guide/static-deploy.md b/docs/guide/static-deploy.md index e8d9cc9ba8360c..e3ba7665ba7b4a 100644 --- a/docs/guide/static-deploy.md +++ b/docs/guide/static-deploy.md @@ -138,24 +138,28 @@ You can also run the above script in your CI setup to enable automatic deploymen If you are deploying to `https://.gitlab.io//`, for example your repository is at `https://gitlab.com//`, then set `base` to `'//'`. -2. Set `build.outDir` in `vite.config.js` to `public`. - -3. Create a file called `.gitlab-ci.yml` in the root of your project with the content below. This will build and deploy your site whenever you make changes to your content: +2. Create a file called `.gitlab-ci.yml` in the root of your project with the content below. This will build and deploy your site whenever you make changes to your content: ```yaml - image: node:10.22.0 + image: node:16.5.0 pages: + stage: deploy cache: + key: + files: + - package-lock.json + prefix: npm paths: - node_modules/ script: - npm install - npm run build + - cp -a dist/. public/ artifacts: paths: - public - only: - - master + rules: + - $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH ``` ## Netlify