Skip to content

Commit

Permalink
初始化仓库
Browse files Browse the repository at this point in the history
  • Loading branch information
ermaozi committed Aug 14, 2023
0 parents commit f7af43d
Show file tree
Hide file tree
Showing 38 changed files with 8,230 additions and 0 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/clear.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: 每周删除提交记录
on:
workflow_dispatch:
schedule:
- cron: '0 2 * * 1'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: 删除提交记录
run: |
git config --global user.name "ermaozi"
git config --global user.email [email protected]
git checkout --orphan new_branch
git commit -m "初始化仓库"
git branch -D main
git branch -m main
git push -f origin main
38 changes: 38 additions & 0 deletions .github/workflows/get_projaec_info.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: 更新项目信息
on:
workflow_dispatch:
schedule:
- cron: '0 */12 * * *'
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: 迁出代码
uses: actions/checkout@v2
- name: 安装Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: 加载缓存
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/run_in_Actions/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: 设置时区
run: sudo timedatectl set-timezone 'Asia/Shanghai'
- name: 安装依赖
run: |
pip install -r requirements.txt
- name: 执行任务
run: |
python get_projaec_info.py --user ermaozi --project get_subscribe --save_path mail/project_info.svg --theme dark --token ${{ secrets.TOKEN }}
- name: 提交更改
run: |
git config core.ignorecase false
git config --local user.email "[email protected]"
git config --local user.name "ermaozi"
git add .
git commit -m "更新项目信息"
git push
44 changes: 44 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: 自动采集

# 触发条件
on:
workflow_dispatch:
# 定时触发
schedule:
# 每6小时获取一次
- cron: '0 */12 * * *'

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: 迁出代码
uses: actions/checkout@v2
- name: 安装Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: 加载缓存
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/run_in_Actions/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: 设置时区
run: sudo timedatectl set-timezone 'Asia/Shanghai'
- name: 安装依赖
run: |
pip install -r requirements.txt
- name: 执行任务
run: |
python main.py
- name: 提交更改
run: |
git config core.ignorecase false
git config --local user.email "[email protected]"
git config --local user.name "ermaozi"
git add .
git commit -m "$(date '+%Y-%m-%d %H:%M:%S')更新订阅链接"
git push
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
venv/
Loading

0 comments on commit f7af43d

Please sign in to comment.