yanglbme / Gitee Pages Action
Licence: mit
🤖 Auto Deploy Gitee Pages | 无须人为干预,自动部署 Gitee Pages
Stars: ✭ 265
Programming Languages
python
139335 projects - #7 most used programming language
Labels
Projects that are alternatives of or similar to Gitee Pages Action
Distillery
Every alchemist requires good tools, and one of the greatest tools in the alchemist's disposal
is the distillery. The purpose of the distillery is to take something and break it down to its
component parts, reassembling it into something better, more powerful. That is exactly
what this project does - it takes your Mix project and produces an Erlang/OTP release, a
distilled form of your raw application's components; a single package which can be deployed anywhere,
independently of an Erlang/Elixir installation. No dependencies, no hassle.
Stars: ✭ 2,869 (+982.64%)
Mutual labels: deployment
pharo-server-tools
Tools to deploy and manage headless Pharo servers from the command line
Stars: ✭ 25 (-90.57%)
Mutual labels: deployment
deploy-drone
Deploy Drone CI to enable continuous integration ⚡️ on your product
Stars: ✭ 88 (-66.79%)
Mutual labels: deployment
tarantool rs
Sync/Async tarantool database connector. WORK IN PROGRESS. DON'T SHARE THIS REPO
Stars: ✭ 14 (-94.72%)
Mutual labels: sync
Taiyakianime
Stream anime and synchronize with your MyAnimeList(MAL) + SIMKL + Anilist on iOS and Android devices
Stars: ✭ 259 (-2.26%)
Mutual labels: sync
PyFiSync
Python (+ rsync or rclone) based intelligent file sync with automatic backups and file move/delete tracking.
Stars: ✭ 88 (-66.79%)
Mutual labels: sync
docker-service-registrator-kong
A docker service registrator for the Kong API Gateway
Stars: ✭ 14 (-94.72%)
Mutual labels: sync
forge
🔥 Incubator of pet projects, tools, pet projects. Edge cases and failovers included.
Stars: ✭ 33 (-87.55%)
Mutual labels: deployment
redefined.cloud
☁ Open source guide re-defining Cloud computing terms & patterns to better understand how it works
Stars: ✭ 23 (-91.32%)
Mutual labels: deployment
react-native-sync-adapter
Schedule background data synchronization using React Native.
Stars: ✭ 112 (-57.74%)
Mutual labels: sync
hyperform
⚡ Lightweight serverless framework for NodeJS
Stars: ✭ 156 (-41.13%)
Mutual labels: deployment
Appimageupdate
AppImageUpdate lets you update AppImages in a decentral way using information embedded in the AppImage itself.
Stars: ✭ 261 (-1.51%)
Mutual labels: deployment
Gitee Pages Action
由于 Gitee Pages 的访问速度很快,很多朋友会选择 Gitee Pages 部署项目(如:个人博客、开源项目国内镜像站点)。但是它不像 GitHub Pages 那样,一提交代码就能自动更新 Pages,因为 Gitee 的自动部署属于 Gitee Pages Pro 的服务。
为了实现 Gitee Pages 的自动部署,我开发了 Gitee Pages Action ,只需要在 GitHub 项目的 Settings 页面下配置 keys,然后在 .github/workflows/
下创建一个工作流,引入一些配置参数即可。欢迎体验,若有使用上的问题,也欢迎随时在 Issues 反馈。
注:首次需要手动登录 Gitee ,点击“启动”进行 Gitee Pages 服务的部署。
入参
参数 | 描述 | 是否必传 | 默认值 | 示例 |
---|---|---|---|---|
gitee-username |
Gitee 用户名 | 是 | - | yanglbme |
gitee-password |
Gitee 密码 | 是 | - | ${{ secrets.GITEE_PASSWORD }} |
gitee-repo |
Gitee 仓库(严格区分大小写) | 是 | - | doocs/advanced-java |
branch |
要部署的分支(分支必须存在) | 否 | master |
main |
directory |
要部署的分支上的目录 | 否 | src |
|
https |
是否强制使用 HTTPS | 否 | true |
false |
示例
以下是一个完整示例。
在你的 GitHub 仓库 .github/workflows/
文件夹下创建一个 .yml
文件,如 sync.yml
,内容如下:
name: Sync
on: page_build
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Sync to Gitee
uses: wearerequired/[email protected]
env:
# 注意在 Settings->Secrets 配置 GITEE_RSA_PRIVATE_KEY
SSH_PRIVATE_KEY: ${{ secrets.GITEE_RSA_PRIVATE_KEY }}
with:
# 注意替换为你的 GitHub 源仓库地址
source-repo: [email protected]:doocs/advanced-java.git
# 注意替换为你的 Gitee 目标仓库地址
destination-repo: [email protected]:Doocs/advanced-java.git
- name: Build Gitee Pages
uses: yanglbme/[email protected]
with:
# 注意替换为你的 Gitee 用户名
gitee-username: yanglbme
# 注意在 Settings->Secrets 配置 GITEE_PASSWORD
gitee-password: ${{ secrets.GITEE_PASSWORD }}
# 注意替换为你的 Gitee 仓库,仓库名严格区分大小写,请准确填写,否则会出错
gitee-repo: doocs/advanced-java
# 要部署的分支,默认是 master,若是其他分支,则需要指定(指定的分支必须存在)
branch: main
先使用 wearerequired/git-mirror-action 将 GitHub 仓库同步到 Gitee 仓库,再使用 yanglbme/gitee-pages-action 实现 Gitee Pages 的自动部署。
密钥的配置步骤如下(可展开看示例图):
1. 在命令行终端或 Git Bash 使用命令 ssh-keygen -t rsa -C "[email protected]"
生成 SSH Key,注意替换为自己的邮箱。生成的 id_rsa
是私钥,id_rsa.pub
是公钥。(⚠️注意此处不要设置密码)
2. 在 GitHub 项目的「Settings -> Secrets」路径下配置好命名为 GITEE_RSA_PRIVATE_KEY
和 GITEE_PASSWORD
的两个密钥。其中:GITEE_RSA_PRIVATE_KEY
存放 id_rsa
私钥;GITEE_PASSWORD
存放 Gitee 帐号的密码。
3. 在 GitHub 的个人设置页面「Settings -> SSH and GPG keys」 配置 SSH 公钥(即:id_rsa.pub
),命名随意。
4. 在 Gitee 的个人设置页面「安全设置 -> SSH 公钥」 配置 SSH 公钥(即:id_rsa.pub
),命名随意。
如果一切配置正常,并成功触发 Gitee Pages Action ,我们会在 Gitee 公众号收到一条登录通知。这是 Gitee Pages Action 程序帮我们登录到 Gitee 官网,并为我们点击了项目的部署按钮。
错误及解决方案
# | 错误 | 解决方案 |
---|---|---|
1 | Error: Wrong username or password, login failed . | 帐号或密码错误,请检查参数 gitee-username 、gitee-password 是否准确配置。 |
2 | Error: Need captcha validation, please visit https://gitee.com/login, login to validate your account. | 需要图片验证码校验。可以手动登录 Gitee 官方,校验验证码。 |
3 | Error: Need phone captcha validation, please follow gitee wechat subscription and bind your account. | 需要短信验证码校验。可以关注 Gitee 微信公众号,并绑定 Gitee 帐号,接收登录提示。#6 |
4 | Error: Do not deploy frequently, try again one minute later. | 短期内频繁部署 Gitee Pages 导致,可以稍后再触发自动部署。 |
5 | Error: Deploy error occurred, please check your input gitee-repo . |
gitee-repo 参数格式如:doocs/advanced-java ,并且严格区分大小写,请准确填写。#10
|
6 | Error: Unknown error occurred in login method, resp: ... | 登录出现未知错误,请在 issues 区反馈。 |
7 | Error: Rebuild page error, status code: xxx | 更新 Pages 时状态码异常,请尝试再次触发 Action 执行。也可能为 gitee pages 未初始化,第一次需要手动部署 gitee pages。 |
8 | Error: HTTPSConnectionPool(host='gitee.com', port=443): Read timed out. (read timeout=6) | 网络请求出错,请尝试 Re-run jobs 。#27 |
9 |
[email protected]: Permission denied (publickey). fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists.. |
SSH 公私钥配置有问题,或是使用了带密码的私钥,请参照上文提及的密钥配置步骤进行相应配置。#29 |
10 | Hexo Gitee Pages 自动部署站点问题。 | @No5972 详细给出了一种解决方案。#34 |
... | ... | ... |
注:
-
branch
参数默认是master
,如果你是部署在gh-pages
(或者main
) 分支等等,务必指定branch: gh-pages
(或者branch: main
)。 -
branch
对应的分支,必须在仓库中实际存在,请不要随意(不)指定分支,否则可能导致 Gitee Pages 站点出现 404 无法访问的情况。 - 示例中触发 Action 执行的事件设置为
page_build
,你也可以根据实际情况指定为其它的触发事件。如下:on: push: branches: [main, master]
更多触发事件,请参考 Events that trigger workflows。
谁在使用
蚂蚁金服 - 数据可视化 |
Doocs 技术社区 |
有赞 |
License
Note that the project description data, including the texts, logos, images, and/or trademarks,
for each open source project belongs to its rightful owner.
If you wish to add or remove any projects, please contact us at [email protected].