-
Notifications
You must be signed in to change notification settings - Fork 1
184 lines (161 loc) · 5.32 KB
/
daily.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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
name: DailyTask
on:
# push:
# branches:
# - main
# 东八区每天八点多运行
schedule:
- cron: "0 0 * * *"
# 标星时运行
# watch:
# types: [started]
workflow_dispatch:
inputs:
debug_enabled:
type: boolean
description: 'Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)'
required: false
default: false
jobs:
autogreen:
runs-on: ubuntu-latest
steps:
- name: Clone repository
uses: actions/checkout@v2
with:
# 这里必须是0, gitee 不允许 shallow push
fetch-depth: 0
ref: tasks
persist-credentials: false
- name: Setup PHP Action
uses: shivammathur/[email protected]
- name: My-Tasks
run: |
# 设置Git
if [ 'a${{ secrets.PUSH_EMAIL }}' != 'a' ]; then
git config --local user.name ${{ github.actor }}
git config --local user.email ${{ secrets.PUSH_EMAIL }}
else
git config --local user.name "github-actions[bot]"
git config --local user.email "github-actions[bot]@users.noreply.github.com"
fi
git remote set-url origin https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}
# https://github.com/mouday/wallpaper-database
# 获取必应壁纸
cd ./Bing && php index.php && cd ..
# 记录log
date +"%Y-%m-%d %H:%M:%S.%N" >> Tasks.log
# 推送
git add .
git commit -am "A commit a day keeps girlfriend away."
git push origin tasks
# gitee-ssh
if [ 'a${{ secrets.GITEE_RSA }}' != 'a' ]; then
mkdir ~/.ssh
echo 'StrictHostKeyChecking no
# gitee
Host gitee.com
HostName gitee.com
PreferredAuthentications publickey
IdentityFile ~/.ssh/Gitee_rsa' > ~/.ssh/config
echo '${{ secrets.GITEE_RSA }}' > ~/.ssh/Gitee_rsa
chmod 600 ~/.ssh/*
ssh -T [email protected]
git remote add Gitee [email protected]:${{ github.repository }}.git
git push Gitee tasks -f
fi
wakabox:
name: Update-wakabox-gist
runs-on: ubuntu-latest
env:
WAKATIME_API_KEY: ${{ secrets.WAKATIME_API_KEY }}
GH_TOKEN: ${{ secrets.GH_TOKEN }}
GIST_ID: 4f05baa3e214af5fb92660d3cb44c238
GIST_BARSTYLE: SOLIDLT
GIST_BARLENGTH: -1
GIST_TIMESTYLE: SHORT
steps:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: ^1.18
id: go
- name: Clone repository
uses: actions/checkout@v3
with:
repository: 'XiaoMiku01/waka-box-go'
# 设置 path 的话, checkout 之后需要 cd 切进去
# path: 'waka-box-go'
- name: Update-gist
run: go run ./cmd/box/main.go
wakeup-and-checkssl:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
ref: gh-pages
- name: wakeup & Build
run: |
curl ${{ secrets.URL }}
chmod +x checker.sh
./checker.sh ${{ secrets.URL }}
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
# external_repository: username/external-repository
# publish_branch: your-branch # default: gh-pages
publish_dir: .
# 如果不设置下面, 会以用户名义提交, 与上面的Auto-green重复
user_name: 'github-actions[bot]'
user_email: 'github-actions[bot]@users.noreply.github.com'
mirror:
runs-on: ubuntu-latest
steps:
- name: Mirror Weidows-projects
uses: Yikun/hub-mirror-action@master
with:
src: github/Weidows-projects
dst: gitee/weidows-projects
dst_key: ${{ secrets.GITEE_RSA }}
dst_token: ${{ secrets.GITEE_TOKEN }}
account_type: org
force_update: true
# white_list:
black_list: '.github'
# static_list:
- name: Mirror Hebau-Community
uses: Yikun/hub-mirror-action@master
with:
src: github/Hebau-Community
dst: gitee/Hebau-Community
dst_key: ${{ secrets.GITEE_RSA }}
dst_token: ${{ secrets.GITEE_TOKEN }}
account_type: org
force_update: true
# white_list:
black_list: '.github'
# static_list:
# - name: Mirror personal
# uses: Yikun/hub-mirror-action@master
# with:
# src: github/Weidows
# dst: gitee/Weidows
# dst_key: ${{ secrets.GITEE_RSA }}
# dst_token: ${{ secrets.GITEE_TOKEN }}
# white_list: ""
# black_list:
# static_list:
# force_update: true
# https://github.com/mxschmitt/action-tmate
ssh-debug:
runs-on: ubuntu-latest
steps:
# Enable tmate debugging of manually-triggered workflows if the input option was provided
- name: Setup tmate session
uses: mxschmitt/action-tmate@v3
if: ${{ github.event_name == 'workflow_dispatch' && inputs.debug_enabled }}
timeout-minutes: 15
with:
limit-access-to-actor: true