无法使用Gitlab页面部署VueJS

时间:2019-04-10 14:48:52

标签: vue.js gitlab

我过去曾使用Gitlab页面进行React部署,除了VueJS之外,它们都运行良好。在遵循示例here之后,即使在GitLab CI管道成功之后,我仍然无法为Gitlab页面生成网站链接。有人可以帮忙吗?

.gitlab-ci.yml如下所示:

# .gitlab-ci.yml file to be placed in the root of your repository

pages: # the job must be named pages
  image: node:latest
  stage: deploy
  script:
    - npm ci
    - 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)
  artifacts:
    paths:
      - public # artifact path must be /public for GitLab Pages to pick it up
  only:
    - master

这是vue.config.js的样子:

// 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'
    ? '/yourProjectName/'
    : '/'
}

提交并推送更改后,GitLab CI管道从运行更改为成功。我期待在Settings > Pages上看到我的网站链接。我单击了它,但没有看到它。怎么了?

0 个答案:

没有答案