Skip to content

circle_translate

circle_translate #6791

name: circle_translate
# Controls when the workflow will run
on:
schedule:
- cron: '0 */2 * * *'
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-20.04
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
with:
token: ${{ secrets.WORK_TOKEN }}
- name: Set up Python 3.8
uses: actions/setup-python@v4
with:
python-version: '3.8'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install beautifulsoup4 pygtrans
pip install -r requirements.txt
- name: ls_show
run: |
python main.py
ls -al rss/
- name: PUSH
env:
U_NAME: ${{ secrets.U_NAME }}
U_EMAIL: ${{ secrets.U_EMAIL }}
run: |
pwd
git config --local user.name "${U_NAME}" #修改name
git config --local user.email "${U_EMAIL}" #修改email
git status -s
git add rss/*
git add test.ini
git add .github/workflows/circle_translate.yml
git add README.md
export TZ='Asia/Shanghai' # 更改时区
git commit -m "Github RSS Translate Auto Builder at `date +"%Y-%m-%d %H:%M"`" # 提交记录包含时间 跟上面更改时区配合
echo "======git push===="
git push