Skip to content

update

update #969

Workflow file for this run

name: update
on:
schedule:
- cron: '30 19 * * *' #每日更新
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest #运行环境
steps:
- name: Checkout
uses: actions/checkout@v3
- name: 'Git set'
run: |
git init
git pull
- name: 'Set up Python'
uses: actions/setup-python@v4
with:
python-version: 3.12.8 #v3
- name: 'Install requirements'
run: |
pip install wget
pip install bs4
pip install urllib3 #安装依赖
pip install retrying
- name: 'Working'
run:
python update.py #运行主程序
- name: Record time
run: echo `date` > date.log
- name: Commit files
run: |
git diff
git config --local user.email "[email protected]"
git config --local user.name "Ravello-H"
git add -A
git commit -m "`date '+%Y-%m-%d %H:%M:%S'`" || exit #动态提交信息
git status
git push -f
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
sync:
needs: build
runs-on: ubuntu-latest
continue-on-error: True
steps:
- uses: wearerequired/git-mirror-action@master
env:
SSH_PRIVATE_KEY: ${{ secrets.GITEE_PRIVATE_KEY }}
with:
source-repo: "[email protected]:RavelloH/EverydayNews.git"
destination-repo: "[email protected]:ravelloh/EverydayNews.git"
reload-pages:
needs: sync
runs-on: ubuntu-latest
continue-on-error: True
steps:
- name: reload
uses: mizuka-wu/[email protected]
with:
repository: RavelloH/EverydayNews
cookie: ${{ secrets.GITEE_COOKIE }}
branch: main
https: true
sesrch:
needs: build
runs-on: ubuntu-latest #运行环境
steps:
- name: Checkout
uses: actions/checkout@v3
- name: 'Git set'
run: |
git init
git pull
- name: 'Set up Python'
uses: actions/setup-python@v4
with:
python-version: 3.7 #v3
- name: 'Install requirements'
run: |
pip install bs4
- name: 'Working'
run:
python search.py #运行主程序
- name: Commit files
continue-on-error: True
run: |
git diff
git config --local user.email "[email protected]"
git config --local user.name "Ravello-H"
git add -A
git commit -m "[RPageSearch]`date '+%Y-%m-%d %H:%M:%S'`" || exit #动态提交信息
git status
git push -f