-
Notifications
You must be signed in to change notification settings - Fork 105
58 lines (50 loc) · 1.73 KB
/
cron-job.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
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