121 lines (105 loc) · 4.07 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
# workflow name
name: sync
# master branch on push, auto run
on:
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x]
steps:
# check it to your workflow can access it
# from: https://github.com/actions/checkout
- name: 检查master分支
uses: actions/checkout@master
with:
fetch-depth: 0
# - name: Sync to Gitee
# uses: wearerequired/git-mirror-action@master
# env:
# # 注意在 Settings->Secrets 配置 DEPLOY_KEY
# SSH_PRIVATE_KEY: ${{ secrets.DEPLOY_KEY }}
# with:
# # 注意替换为你的 GitHub 源仓库地址
# source-repo: git@github.com:kkfive/kkfive.github.io.git
# # 注意替换为你的 Gitee 目标仓库地址
# destination-repo: git@gitee.com:kkfive/kkfive.git
# - name: 自动部署gitee
# uses: yanglbme/gitee-pages-action@master
# with:
# # 注意替换为你的 Gitee 用户名
# gitee-username: kkfive
# # 注意在 Settings->Secrets 配置 GITEE_PASSWORD
# gitee-password: ${{ secrets.GITEE_PASSWORD }}
# # 注意替换为你的 Gitee 仓库
# gitee-repo: kkfive/kkfive
# - name: Install coscmd
# run: sudo pip install coscmd
# - name: Configure coscmd
# env:
# SECRET_ID: ${{ secrets.TENCENT_CLOUD_SECRET_ID }}
# SECRET_KEY: ${{ secrets.TENCENT_CLOUD_SECRET_KEY }}
# BUCKET: ${{ secrets.COS_BUCKET }}
# REGION: ${{ secrets.COS_REGION }}
# run: coscmd config -a $SECRET_ID -s $SECRET_KEY -b $BUCKET -r $REGION
# - name: Upyun login
# uses: ffx0s/upx-actions@master
# with:
# bucket: ${{secrets.UPYUN_BUCKET}}
# operator: ${{ secrets.UPYUN_OPERATOR }}
# password: ${{ secrets.UPYUN_PASSWORD }}
# - name: 上传到cos
# run: coscmd upload -rfs --delete ./ / --ignore "./.git/*"
# - name: 上传到OSS
# uses: fangbinwei/aliyun-oss-website-action@v1
# with:
# accessKeyId: ${{ secrets.ALI_ACCESS_KEY_ID }}
# accessKeySecret: ${{ secrets.ALI_ACCESS_KEY_SECRET }}
# bucket: ${{ secrets.ALI_BUCKET }}
# endpoint: ${{ secrets.ALI_ENDPOINT }}
# folder: "./"
# exclude: |
# .git/
# - name: Sync to Bitbucket
# uses: wearerequired/git-mirror-action@master
# env:
# # 注意在 Settings->Secrets 配置 DEPLOY_KEY
# SSH_PRIVATE_KEY: ${{ secrets.DEPLOY_KEY }}
# with:
# # 注意替换为你的 GitHub 源仓库地址
# source-repo: git@github.com:kkfive/kkfive.github.io.git
# # 注意替换为你的 bitbucket 目标仓库地址
# destination-repo: git@bitbucket.org:DreamyTZK/www.antmoe.com.git
# - name: 上传到又拍云
# run: |
# rm -rf .git
# upx sync ./ / --delete
# - name: Sync to GitLab
# uses: wearerequired/git-mirror-action@master
# env:
# # 注意在 Settings->Secrets 配置 DEPLOY_KEY
# SSH_PRIVATE_KEY: ${{ secrets.DEPLOY_KEY }}
# with:
# # 注意替换为你的 GitHub 源仓库地址
# source-repo: git@github.com:kkfive/kkfive.github.io.git
# # 注意替换为你的 gitlab 目标仓库地址
# destination-repo: git@gitlab.com:DreamyTZK/www.antmoe.com.git
- name: Update Cache And Sync to Telegram
env:
BOT_TOKEN: ${{ secrets.BOT_TOKEN }}
TENCENT_SECRET_ID: ${{ secrets.TENCENT_SECRET_ID }}
TENCENT_SECRET_KEY: ${{ secrets.TENCENT_SECRET_KEY }}
UPYUN_TOKEN: ${{ secrets.UPYUN_TOKEN }}
run: |
yarn install
node clearCache.js
# node sync-message.js
- name: Delete workflow runs
uses: Mattraks/delete-workflow-runs@v2
with:
retain_days: 1
keep_minimum_runs: 1