Skip to content

Commit 15afb87

Browse files
committed
gitee sync enable
1 parent 4e8bb48 commit 15afb87

3 files changed

Lines changed: 293 additions & 291 deletions

File tree

.github/workflows/gh-pages.yml

Lines changed: 77 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -1,77 +1,77 @@
1-
name: GitHub Pages
2-
3-
on:
4-
push:
5-
branches:
6-
- master # Set a branch to deploy
7-
pull_request:
8-
9-
jobs:
10-
deploy:
11-
runs-on: ubuntu-20.04
12-
concurrency:
13-
group: ${{ github.workflow }}-${{ github.ref }}
14-
steps:
15-
- uses: actions/checkout@v2
16-
with:
17-
submodules: recursive # Fetch the Docsy theme
18-
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod
19-
20-
- name: Setup Hugo
21-
uses: peaceiris/actions-hugo@v2
22-
with:
23-
hugo-version: '0.91.2'
24-
extended: true
25-
26-
- name: Setup Node
27-
uses: actions/setup-node@v2
28-
with:
29-
node-version: '14'
30-
31-
- name: Cache dependencies
32-
uses: actions/cache@v2
33-
with:
34-
path: ~/.npm
35-
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
36-
restore-keys: |
37-
${{ runner.os }}-node-
38-
39-
- run: npm install
40-
- run: env HUGO_ENV="production" hugo --minify
41-
42-
- name: Deploy
43-
uses: peaceiris/actions-gh-pages@v3
44-
if: ${{ github.ref == 'refs/heads/master' }}
45-
with:
46-
github_token: ${{ secrets.GITHUB_TOKEN }}
47-
48-
- run: sed -i 's/https:\/\/xiaoping378.github.io/https:\/\/xiaoping378.gitee.io/' config.toml
49-
- run: env HUGO_ENV="production" hugo --minify
50-
- name: Deploy - gitee pages
51-
uses: peaceiris/actions-gh-pages@v3
52-
if: ${{ github.ref == 'refs/heads/master' }}
53-
with:
54-
github_token: ${{ secrets.GITHUB_TOKEN }}
55-
publish_branch: gitee_pages
56-
- name: Sync to Gitee
57-
uses: wearerequired/git-mirror-action@master
58-
env:
59-
# 注意在 Settings->Secrets 配置 GITEE_RSA_PRIVATE_KEY
60-
SSH_PRIVATE_KEY: ${{ secrets.GITEE_RSA_PRIVATE_KEY }}
61-
with:
62-
# 注意替换为你的 GitHub 源仓库地址
63-
source-repo: git@github.com:xiaoping378/xiaoping378.github.io.git
64-
# 注意替换为你的 Gitee 目标仓库地址
65-
destination-repo: git@gitee.com:xiaoping378/xiaoping378.git
66-
67-
- name: Build Gitee Pages
68-
uses: yanglbme/gitee-pages-action@main
69-
with:
70-
# 注意替换为你的 Gitee 用户名
71-
gitee-username: xiaoping378@163.com
72-
# 注意在 Settings->Secrets 配置 GITEE_PASSWORD
73-
gitee-password: ${{ secrets.GITEE_PASSWORD }}
74-
# 注意替换为你的 Gitee 仓库,仓库名严格区分大小写,请准确填写,否则会出错
75-
gitee-repo: xiaoping378/xiaoping378
76-
# 要部署的分支,默认是 master,若是其他分支,则需要指定(指定的分支必须存在)
77-
branch: gitee_pages
1+
name: GitHub Pages
2+
3+
on:
4+
push:
5+
branches:
6+
- master # Set a branch to deploy
7+
pull_request:
8+
9+
jobs:
10+
deploy:
11+
runs-on: ubuntu-20.04
12+
concurrency:
13+
group: ${{ github.workflow }}-${{ github.ref }}
14+
steps:
15+
- uses: actions/checkout@v2
16+
with:
17+
submodules: recursive # Fetch the Docsy theme
18+
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod
19+
20+
- name: Setup Hugo
21+
uses: peaceiris/actions-hugo@v2
22+
with:
23+
hugo-version: '0.91.2'
24+
extended: true
25+
26+
- name: Setup Node
27+
uses: actions/setup-node@v2
28+
with:
29+
node-version: '14'
30+
31+
- name: Cache dependencies
32+
uses: actions/cache@v2
33+
with:
34+
path: ~/.npm
35+
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
36+
restore-keys: |
37+
${{ runner.os }}-node-
38+
39+
- run: npm install
40+
- run: env HUGO_ENV="production" hugo --minify
41+
42+
- name: Deploy
43+
uses: peaceiris/actions-gh-pages@v3
44+
if: ${{ github.ref == 'refs/heads/master' }}
45+
with:
46+
github_token: ${{ secrets.GITHUB_TOKEN }}
47+
48+
# - run: sed -i 's/https:\/\/xiaoping378.github.io/https:\/\/xiaoping378.gitee.io/' config.toml
49+
# - run: env HUGO_ENV="production" hugo --minify
50+
# - name: Deploy - gitee pages
51+
# uses: peaceiris/actions-gh-pages@v3
52+
# if: ${{ github.ref == 'refs/heads/master' }}
53+
# with:
54+
# github_token: ${{ secrets.GITHUB_TOKEN }}
55+
# publish_branch: gitee_pages
56+
# - name: Sync to Gitee
57+
# uses: wearerequired/git-mirror-action@master
58+
# env:
59+
# # 注意在 Settings->Secrets 配置 GITEE_RSA_PRIVATE_KEY
60+
# SSH_PRIVATE_KEY: ${{ secrets.GITEE_RSA_PRIVATE_KEY }}
61+
# with:
62+
# # 注意替换为你的 GitHub 源仓库地址
63+
# source-repo: git@github.com:xiaoping378/xiaoping378.github.io.git
64+
# # 注意替换为你的 Gitee 目标仓库地址
65+
# destination-repo: git@gitee.com:xiaoping378/xiaoping378.git
66+
67+
# - name: Build Gitee Pages
68+
# uses: yanglbme/gitee-pages-action@main
69+
# with:
70+
# # 注意替换为你的 Gitee 用户名
71+
# gitee-username: xiaoping378@163.com
72+
# # 注意在 Settings->Secrets 配置 GITEE_PASSWORD
73+
# gitee-password: ${{ secrets.GITEE_PASSWORD }}
74+
# # 注意替换为你的 Gitee 仓库,仓库名严格区分大小写,请准确填写,否则会出错
75+
# gitee-repo: xiaoping378/xiaoping378
76+
# # 要部署的分支,默认是 master,若是其他分支,则需要指定(指定的分支必须存在)
77+
# branch: gitee_pages

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@
22
resources/
33
node_modules/
44
package-lock.json
5-
.hugo_build.lock
5+
.hugo_build.lock
6+
.obsidian/

0 commit comments

Comments
 (0)