-
Notifications
You must be signed in to change notification settings - Fork 0
62 lines (61 loc) · 2.35 KB
/
sync.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# name: Sync To Gitee #名字 可自定义
# on: [push, delete, create] #触发条件 page_build表示Github Page部署完成后触发
# jobs:
# sync:
# runs-on: ubuntu-latest
# steps:
# - uses: wearerequired/git-mirror-action@master #开源actions包
# env:
# SSH_PRIVATE_KEY: ${{ secrets.GITEE_PRIVATE_KEY }}
# with:
# source-repo: '[email protected]:Tricker39/programming-knowledge.git' # github仓库地址
# destination-repo: '[email protected]:Tricker39/programming-knowledge.git' # gitee仓库地址
name: A TO A:GH_PAGES
on: [push]
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@master
- name: Build and Deploy
uses: jenkey2011/vuepress-deploy@master
env:
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}
# 你要操作的目标仓库
TARGET_REPO: Tricker39/programming-knowledge
# 构建结果存储的分支
TARGET_BRANCH: gh_pages
# 要使用的构建命令
BUILD_SCRIPT: npm install && npm run docs:build
# 构建结果存储目录
BUILD_DIR: .vitepress/dist/
sync:
needs: build-and-deploy
runs-on: ubuntu-latest
steps:
- name: Sync to Gitee
uses: wearerequired/git-mirror-action@master
env:
SSH_PRIVATE_KEY: ${{ secrets.GITEE_RSA_PRIVATE_KEY }}
SSH_KNOWN_HOSTS: ${{ secrets.SSH_KNOWN_HOSTS }}
with:
# 来源仓库
source-repo: '[email protected]:Tricker39/programming-knowledge.git'
# 目标仓库
destination-repo: '[email protected]:Tricker39/programming-knowledge.git'
reload-pages:
needs: sync
runs-on: ubuntu-latest
steps:
- name: Build Gitee Pages
uses: yanglbme/gitee-pages-action@main
with:
# 注意替换为你的 Gitee 用户名
gitee-username: Tricker39
# 注意在 Settings->Secrets 配置 GITEE_PASSWORD
gitee-password: ${{ secrets.GITEE_PASSWORD }}
# 注意替换为你的 Gitee 仓库,仓库名严格区分大小写,请准确填写,否则会出错
gitee-repo: Tricker39/programming-knowledge
# 要部署的分支,默认是 master,若是其他分支,则需要指定(指定的分支必须存在)
branch: gh_pages