-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from nishuiq/main
添加支持Github Actions 执行定时任务
- Loading branch information
Showing
3 changed files
with
79 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
name: SenKongDao Daily Schedule Workflow | ||
|
||
on: | ||
schedule: | ||
- cron: '0 20 * * *' # UTC+8=凌晨4点 | ||
workflow_dispatch: # 添加手动触发事件 | ||
|
||
jobs: | ||
run-python-job: | ||
runs-on: ubuntu-latest | ||
|
||
env: | ||
UID: ${{ secrets.UID }} | ||
ATOKEN: ${{ secrets.ATOKEN }} | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.10' | ||
cache: 'pip' | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -r requirements.txt | ||
- name: Run Python script | ||
if: github.event_name == 'schedule' | ||
run: python SenKongDao.py | ||
|
||
- name: Manual Test Step | ||
if: github.event_name == 'workflow_dispatch' | ||
run: python SenKongDao.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters