GitHub Actions Youthstudy Bot #449
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: | |
push: true #不需要推送的请改为false | |
MEMBER: ${{ secrets.mid }} | |
PUSHTOKEN: ${{ secrets.PUSHTOKEN }} | |
jobs: | |
youthstudymark: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v3 | |
- name: Set up env | |
run: pip install -r requirements.txt | |
- name: Run main command | |
run: python main.py | |
- name: Submit previous activity | |
if: github.event.inputs.previous == 'yes' | |
run: python previous.py | |
- name: Push result to Wechat by pushplus | |
if: env.push == 'true' | |
run: python push.py |