![](/img/trans.png)
[英]How can I use GitLab pages to host webpages with a user input form, which updates a GitLab repo when saved?
[英]Host static website with GitLab pages
我需要使用gitlab頁面托管一個靜態網站。 我的repo是一個私有存儲庫(或項目),我嘗試使用的.gitlab-ci.yml
如下所示:
image: gpecchio:BeCall
pages:
stage: deploy
script:
- echo 'Nothing to do...'
artifacts:
paths:
- private
only:
- master
我相信image
是錯誤的,但我不知道要改變它的內容。 我做了一些研究,但GitLab頁面沒有那么多的在線教程。 我怎么能改變這個文件才能使它工作?
其他可能有用的信息:
GitLab用戶名:gpecchio
GitLab項目名稱:BeCall
GitLab項目網址: https ://gitlab.com/gpecchio/BeCall
您的網站是用html創建的,還是使用靜態生成器來創建您的網站,然后使用gitlab頁面來托管它?
在.gitlab-ci.yml文件中,工件需要公開(即使您的存儲庫是私有的),以便使用gitlab頁面托管您的網站。
以下是您使用gitlab頁面托管站點時.gitlab -ci.yml文件需要的一些示例。
HTML
pages:
stage: deploy
script:
- mkdir .public
- cp -r * .public
- mv .public public
artifacts:
paths:
- public
only:
- master
傑奇
image: ruby:2.3
pages:
stage: deploy
script:
- gem install jekyll
- jekyll build -d public/
artifacts:
paths:
- public
only:
- master
HEXO
image: node:4.2.2
pages:
cache:
paths:
- node_modules/
script:
- npm install hexo-cli -g
- npm install
- hexo deploy
artifacts:
paths:
- public
only:
- master
您應該查看https://gitlab.com/pages/ ,其中包含使用所有不同靜態站點生成器創建並使用gitlab頁面托管的靜態站點示例。
您還可以在https://gitlab.com/groups/jekyll-themes上找到gitlab頁面上托管的一些Jekyll主題
最后,指向你的gitlab項目url: https ://gitlab.com/gpecchio/BeCall的鏈接是私有的。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.