forked from GitHub-Xzhi/AutoSignMachine
-
Notifications
You must be signed in to change notification settings - Fork 0
133 lines (109 loc) · 4.16 KB
/
daily-task.yml
File metadata and controls
133 lines (109 loc) · 4.16 KB
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
name: daily-task
on:
push: # push触发
branches: [ main ]
workflow_dispatch: # 手动触发
schedule: # 计划任务触发
- cron: '*/30 20-23,0-15 * * *' # cron表达式,Actions时区是UTC时间,所以要往前推8个小时(4-23)
jobs:
daily-task:
if: github.event.repository.owner.id == github.event.sender.id
env:
ENABLE_52POJIE: ${{secrets.ENABLE_52POJIE}}
ENABLE_BILIBILI: ${{secrets.ENABLE_BILIBILI}}
ENABLE_IQIYI: ${{secrets.ENABLE_IQIYI}}
ENABLE_UNICOM: ${{secrets.ENABLE_UNICOM}}
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [12]
node-registry: ['https://registry.npmjs.org']
steps:
# 检出
- name: Checkout
uses: actions/checkout@v2
# 设置服务器时区为东八区
- name: Set time zone
run: sudo timedatectl set-timezone 'Asia/Shanghai'
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
registry-url: ${{ matrix.node-registry }}
- name: Get npm cache directory
id: npm-cache
run: |
echo "::set-output name=dir::$(npm config get cache)"
- name: restore npm cache
uses: actions/cache@v2
id: use-npm-cache
with:
path: ${{ steps.npm-cache.outputs.dir }}
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
- name: restore npm dependencies
uses: actions/cache@v2
id: use-npm-depends
with:
path: |
node_modules
*/*/node_modules
key: ${{ runner.os }}-depends-${{ hashFiles('**/package-lock.json') }}
- name: restore task cache
uses: actions/cache@v2
id: use-task-cache
with:
path: |
/home/runner/.AutoSignMachine
key: ${{ runner.os }}-task-${{ hashFiles('**/package-lock.json') }}
- name: Install dependencies
if: steps.use-npm-cache.outputs.cache-hit != 'true' || steps.use-npm-depends.outputs.cache-hit != 'true'
run: npm install --registry=https://registry.npm.taobao.org
# 运行 52pojie 签到任务
- name: Run 52pojie daily task
if: ${{ env.ENABLE_52POJIE }}
env:
htVD_2132_auth: ${{secrets.pojie_htVD_2132_auth}}
htVD_2132_saltkey: ${{secrets.pojie_htVD_2132_saltkey}}
run: node index.js 52pojie --htVD_2132_auth=${htVD_2132_auth} --htVD_2132_saltkey=${htVD_2132_saltkey}
# 运行 bilibili 签到任务
- name: Run bilibili daily task
if: ${{ env.ENABLE_BILIBILI }}
env:
DedeUserID: ${{secrets.bilibili_USERID}}
SESSDATA: ${{secrets.bilibili_SESSDATA}}
bili_jct: ${{secrets.bilibili_BILIJCT}}
otherConfigs: ${{secrets.bilibili_OTHERCONFIGS}}
run: node index.js bilibili --DedeUserID=${DedeUserID} --SESSDATA=${SESSDATA} --bili_jct=${bili_jct} ${otherConfigs}
# 运行 iqiyi 签到任务
- name: Run iqiyi daily task
if: ${{ env.ENABLE_IQIYI }}
env:
P00001: ${{secrets.iqiyi_P00001}}
P00PRU: ${{secrets.iqiyi_P00PRU}}
QC005: ${{secrets.iqiyi_QC005}}
dfp: ${{secrets.iqiyi_DFP}}
run: node index.js iqiyi --P00001=${P00001} --P00PRU=${P00PRU} --QC005=${QC005} --dfp=${dfp}
# 运行 unicom 签到任务
- name: Run unicom daily task
if: ${{ env.ENABLE_UNICOM }}
env:
user: ${{secrets.user}}
password: ${{secrets.password}}
appid: ${{secrets.appid}}
run: node index.js unicom --user=${user} --password=${password} --appid=${appid}
# 运行 unicom 签到任务
- name: Run unicom daily task
if: ${{ env.ENABLE_UNICOM }}
env:
user: ${{secrets.user2}}
password: ${{secrets.password}}
appid: ${{secrets.appid}}
run: node index.js unicom --user=${user} --password=${password} --appid=${appid}
# 运行 unicom 签到任务
- name: Run unicom daily task
if: ${{ env.ENABLE_UNICOM }}
env:
user: ${{secrets.user3}}
password: ${{secrets.password}}
appid: ${{secrets.appid}}
run: node index.js unicom --user=${user} --password=${password} --appid=${appid}