-
Notifications
You must be signed in to change notification settings - Fork 8
41 lines (38 loc) · 1.51 KB
/
cronjob.yaml
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
# Github Workflows that run the main.py every hour.
# Then commit the changes of ./data folders push back to remote
# Ref: https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions#onschedule
name: shopee-track
on:
push:
branches:
- master
schedule:
# You can use https://crontab.guru to help generate
# your cron syntax and confirm what time it will run
#
# ┌───────────── minute 0, 30
# │ ┌───────────── hour (0 - 23)
# │ │ ┌───────────── day of the month (1 - 31)
# │ │ │ ┌───────────── month (1 - 12 or JAN-DEC)
# │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT)
# │ │ │ │ │
# 0,30 * * * *
- cron: "0,30 * * * *"
jobs:
shopee:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Getting data
run: |
pip3 install -r requirements.txt
export PYTHONPATH=.:$PYTHONPATH
python3 ./main.py
- name: Update changes
run: |
now=`date`
git config --global user.name "Robot"
git config --global user.email '[email protected]'
git add ./data
git commit -m "[ci skip] update ${now}" || echo 'Nothing to commit'
git push || echo 'Nothing to push'