Live Spider #34
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: Live Spider | |
on: | |
schedule: | |
- cron: 0 16 * * * # 分钟(0) 小时(0) 日(*) 月(*) 星期几(*) | |
workflow_dispatch: | |
jobs: | |
Spider: | |
runs-on: ubuntu-latest | |
env: | |
TZ: Asia/Shanghai | |
permissions: | |
contents: write | |
security-events: write | |
pull-requests: write | |
steps: | |
- name: Clone TVSpider Repository | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Setup Python | |
uses: actions/setup-python@v3 | |
with: | |
python-version: 3.8 | |
- name: Upgrade Pip | |
run: | | |
python -m pip install --upgrade pip | |
- name: Install requirements | |
run: | | |
pip install -r ./requirements.txt | |
- name: Live Spider | |
run: | | |
python ./main.py | |
- name: Commit Live Config files | |
run: | | |
git config --global user.name ${{ secrets.GT_EMAIL }} | |
git config --global user.email ${{ secrets.GH_ACTOR}} | |
git add json | |
git add live | |
commit_msg="* 更新直播源" | |
git commit -a -m "$commit_msg" | |
- name: Push Live Config Changes To Github | |
uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ github.Token }} | |
directory: . | |
branch: main | |
force: true | |
env: | |
GITHUB_ACTOR: ${{ secrets.GH_ACTOR }} |