-
Notifications
You must be signed in to change notification settings - Fork 43
61 lines (59 loc) · 2.37 KB
/
pica_crawler_actions.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
name: pica_crawler
on:
#将下面两行代码取消注释
#schedule:
#- cron: "0 0 * * *"
workflow_dispatch:
jobs:
main:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@main
- uses: actions/[email protected]
with:
python-version: "3.10"
- name: install dependency
run: |
pip install urllib3
pip install requests
- name: main logic
env:
PICA_SECRET_KEY: ${{secrets.PICA_SECRET_KEY}}
PICA_ACCOUNT: ${{secrets.PICA_ACCOUNT}}
PICA_PASSWORD: ${{secrets.PICA_PASSWORD}}
# 允许在下载完成后发送自定义消息,为空则不发送 例: https://api.day.app/{your_keys}/picacg下载成功
BARK_URL: ${{secrets.BARK_URL}}
run: |
python ./src/main.py
git add ./data/downloaded.db
git add ./logs
# comics文件夹下的所有漫画都会被打成一个压缩包,并上传到actions artifact. 如果不配置邮箱推送功能,可以用这个来下载到漫画
- name: upload-artifact
uses: actions/upload-artifact@v4
with:
name: pica-comics
path: comics/
# 压缩包90天后会被清除
retention-days: 90
- name: send email
env:
EMAIL_ACCOUNT: ${{secrets.EMAIL_ACCOUNT}}
EMAIL_AUTH_CODE: ${{secrets.EMAIL_AUTH_CODE}}
# 收信邮箱的smtp服务器地址
EMAIL_SERVER_HOST: smtp.qq.com
# 压缩包的最大大小(MB),也就是收信邮箱支持的最大附件大小 qq/新浪:50 outlook:20
EMAIL_ATTACH_SIZE: 50
# 收信邮箱服务器的加密方式 true:STARTTLS false:TLS outlook邮箱只能为true,qq邮箱true和false都可以
EMAIL_STARTTLS: true
# 收信邮箱服务器的端口
EMAIL_SERVER_PORT: 587
run: |
python ./src/sendEmail.py
echo '如果不需要邮件推送的功能,可以将上一行代码注释掉 首次运行时也建议注释,排行榜上的漫画都没推送过,邮箱接受不了大量的漫画,等首次运行结束后再开启'
- name: commit & push
uses: actions-go/push@master
with:
author-email: '[email protected]'
author-name: 'GitHub Actions'
commit-message: 'update downloaded comics'
token: ${{ secrets.GIT_TOKEN }}