Vue.js 无法使用Gitlab页面部署VueJS
我在过去使用过Gitlab页面进行React部署,除了VueJS之外,它们工作得很好。在遵循示例之后,即使Gitlab CI管道成功运行,我仍然无法为我的Gitlab页面生成网站链接。有人能帮忙吗 这就是.gitlab-ci.yml的外观:Vue.js 无法使用Gitlab页面部署VueJS,vue.js,gitlab,Vue.js,Gitlab,我在过去使用过Gitlab页面进行React部署,除了VueJS之外,它们工作得很好。在遵循示例之后,即使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 st
# .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 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/'
: '/'
}
这就是vue.config.js的外观:
# .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 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>页面上看到我的网站链接。我点击了它,但我没有看到它。有什么问题吗?您是否在vue.config.js
中将/yourProjectName/
更改为实际的项目名称?是的,我更改了。您阅读了吗?是的,我已经仔细看过了。非常感谢。目前,构建和测试都已通过,但是设置>页面上没有链接
是否为此项目启用了“Gitlab页面”?是否在vue.config.js
中将/yourProjectName/
更改为实际的项目名称?是的,我更改了。您阅读了吗?是的,我已经仔细看过了。非常感谢。目前,构建和测试都已通过,但是Settings>Pages上没有链接
您是否为此项目启用了“Gitlab Pages”?