forked from Doragd/Algorithm-Practice-in-Industry
-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (54 loc) · 1.7 KB
/
push_conf_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
name: push_conf_daily
env:
PYTHON_VERSION: "3.8" # set this to the Python version to use
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
on:
workflow_dispatch:
schedule:
- cron: '0 4 * * *' # 每天 UTC 时间 04:00 触发, 即上海时间12点
jobs:
daily-push:
runs-on: ubuntu-latest
env:
SERVERCHAN_API_KEY: ${{ secrets.SERVERCHAN_API_KEY }}
CAIYUN_TOKEN: ${{ secrets.CAIYUN_TOKEN }}
CONF_URL: ${{ secrets.CONF_URL }}
FEISHU_URL: ${{ secrets.FEISHU_URL }}
INTERVAL: 5
LIMITS: 10
ERROR_LIMITS: 5
DEEPSEEK_API_KEY: ${{ secrets.DEEPSEEK_API_KEY }}
MODEL_TYPE: "DeepSeek"
permissions:
issues: write
contents: write
steps:
- uses: actions/checkout@v3
- name: Set up Python version
uses: actions/setup-python@v3
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Install dependencies
run: pip install tqdm requests openai
- name: PUSH CONF DAILY
run: |
python conf.py
python render.py
- name: Commit files
id: commit
run: |
git config --local user.email "[email protected]"
git config --local user.name "github-actions"
git add --all
if [ -z "$(git status --porcelain)"]; then
echo "::set-output name=push::false"
else
git commit -m "chore: update confs" -a
echo "::set-output name=push::true"
fi
shell: bash
- name: Push changes
if: steps.commit.outputs.push == 'true'
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}