-
-
Notifications
You must be signed in to change notification settings - Fork 25
60 lines (49 loc) · 1.71 KB
/
push.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
59
60
name: Execute On Push
on:
push:
branches:
- main
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
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.11' #Install Latest Python
- name: Install Python Packages Requirements
run: |
python -m pip install --upgrade pip
pip install -r requirements
- name: Execute Python Script
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