簡體   English   中英

更改gitlab頁面上的部署根目錄

[英]Change deploy root on gitlab Pages

我一直在使用.gitlab-ci.yml模板文件創建gitlab頁面:

# This file is a template, and might need editing before it works on your project.
# Full project: https://gitlab.com/user/project
pages:
  stage: deploy
  script:
  - mkdir .public
  - cp -r * .public
  - mv .public public
  artifacts:
    paths:
    - public
  only:
  - master

到目前為止一切順利,它在回購根目錄下運行index.html文件。

問題:我有一個倉庫,其中生產文件位於dist/文件夾中。

如何更改部署以讀取該文件夾上的文件而不是讀取根目錄?

- /src
- /dist 
---- index.html ---> i want to set this as root
---- assets/ 
.gitignore
README.md
gulpfile.js
package.json

----> gitlab is trying to find index.html on the root

您不能直接這樣做,但可以使用以下技巧/技巧:

html具有以下元標記:

<meta http-equiv="refresh" content="0;url=http://repo.github.io/folder/index.html" />

將其提交為index.html,它將索引頁重定向到本地gh-pages分支內所需的任何內部文件。

http-equiv="refresh"會將頁面重定向到您想要的任何所需位置。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM