Skip to content

cron_job

cron_job #5184

Workflow file for this run

name: cron_job
# Controls when the workflow will run
on:
# cron job every 2 hours
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
- name: Check out repository
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 -r requirements.txt
- name: ls_show
run: |
python main.py
ls -al docs/
env:
OPENAI_BASE_URL: ${{ secrets.OPENAI_BASE_URL }}
CUSTOM_MODEL: ${{ secrets.CUSTOM_MODEL }}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
U_NAME: ${{ secrets.U_NAME }}
- name: PUSH
run: |
pwd
git config --local user.name "github-actions[bot]"
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git status -s
git add docs/*
git add README*
export TZ='Europe/London'
git commit -m "Auto Build at `date +"%Y-%m-%d %H:%M"`"
echo "======git push===="
git push