GitHub Actions Youthstudy Bot #645
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
name: 'GitHub Actions Youthstudy Bot' | |
on: | |
workflow_dispatch: | |
inputs: | |
previous: | |
description: '是否打卡往期课程' | |
required: true | |
default: 'no' | |
type: choice | |
options: | |
- 'yes' | |
- 'no' | |
#以上勿动 | |
schedule: | |
# UTC4:00(北京UTC+8 12:00点)触发任务 | |
- cron: '0 4 * * *' | |
env: | |
MEMBER: ${{ secrets.mid }} | |
PUSHTOKEN: ${{ secrets.PUSHTOKEN }} | |
jobs: | |
youthstudymark: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v4 | |
- name: Set up env | |
run: pip install -r requirements.txt | |
- name: Run main command | |
run: python main.py | |
- name: Submit previous studies | |
if: github.event.inputs.previous == 'yes' | |
run: python previous.py | |
- name: Summary & Push | |
run: python summary.py | |
- name: Keep alive | |
uses: gautamkrishnar/keepalive-workflow@v2 |