This repository has been archived by the owner on Jan 31, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 37
63 lines (57 loc) · 2.11 KB
/
master.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
63
name: Build Vuepress and Sync Gitee
on:
push:
branches: [ master ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: '14.x'
# Caching dependencies to speed up workflows. (GitHub will remove any cache entries that have not been accessed in over 7 days.)
- name: Cache node modules
uses: actions/cache@v1
id: cache
with:
path: node_modules
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install Dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: npm i
# Vuepress Build.
- name: Generates Pages
run: |
npm run build
- name: Deploy Github Pages🚀
uses: JamesIves/[email protected]
with:
repository-name: toimc-team/notes-page # The branch the action should deploy to.
branch: master
folder: ./src/.vuepress/dist # The folder the action should deploy.
ssh-key: ${{ secrets.DEPLOY_KEY }}
- name: Sync to Gitee Page
uses: wearerequired/git-mirror-action@master
env:
# 注意在 Settings->Secrets 配置 GITEE_PRIVATE_KEY
SSH_PRIVATE_KEY: ${{ secrets.GITEE_PRIVATE_KEY }}
with:
# 注意替换为你的 GitHub 源仓库地址
source-repo: [email protected]:toimc-team/notes-page.git
# 注意替换为你的 Gitee 目标仓库地址
destination-repo: [email protected]:toimc/notes-page.git
- name: Trigger Gitee Pages Auto Reload
uses: yanglbme/gitee-pages-action@master
with:
# 注意替换为你的 Gitee 用户名
gitee-username: toimc
# 注意在 Settings->Secrets 配置 GITEE_PASSWORD
gitee-password: ${{ secrets.GITEE_PASSWORD }}
# 注意替换为你的 Gitee 仓库,仓库名严格区分大小写,请准确填写,否则会出错
gitee-repo: toimc/notes-page