-
-
Notifications
You must be signed in to change notification settings - Fork 25
58 lines (48 loc) · 1.74 KB
/
schedule.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: Execute On Schedule
on:
schedule:
- cron: '30 */1 * * *' # Executes at 25 minutes past the hour, every 2 hours.
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository Contents
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.12'
- name: Install Python Packages Requirements
run: |
python -m pip install --upgrade pip
pip install -r requirements
- name: Execute Python Script
env:
SOME_SECRET: ${{ secrets.SOME_SECRET }}
run: python main.py
- name: Commit Files
run: |
git config --local user.email "seyyedsoroushmirzaei@protonmail.com"
git config --local user.name "Soroush Mirzaei"
git add -A
git diff-index --quiet HEAD || (git commit -a -m "Updated $(TZ='Asia/Tehran' date '+%Y-%m-%d %H:%M %Z')" --allow-empty)
- name: Push Changes
uses: ad-m/github-push-action@v0.6.0
with:
github_token: ${{ secrets.TG_PRXY_CLCT }}
branch: main
- name: Clean Up Files
run: |
git checkout --orphan latest_branch
git config --local user.email "seyyedsoroushmirzaei@protonmail.com"
git config --local user.name "Soroush Mirzaei"
git add -A
git commit -am "Updated $(TZ='Asia/Tehran' date '+%Y-%m-%d %H:%M %Z')"
git branch -D main
git branch -m main
git push -f origin main
- name: Push Changes
uses: ad-m/github-push-action@v0.6.0
with:
github_token: ${{ secrets.TG_PRXY_CLCT }}
branch: main