Skip to content

Commit b0d6dd3

Browse files
committed
added the cron job back
1 parent f03306c commit b0d6dd3

File tree

6 files changed

+70
-69
lines changed

6 files changed

+70
-69
lines changed

.github/workflows/cron.yml

Lines changed: 68 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -1,80 +1,80 @@
1-
# name: Daily Bot Cron
1+
name: Daily Bot Cron
22

3-
# on:
4-
# schedule:
5-
# - cron: '0 4 * * *' # Run daily at 4 AM UTC
6-
# workflow_dispatch: # Allows manual trigger from GitHub UI
3+
on:
4+
schedule:
5+
- cron: '0 4 * * *' # Run daily at 4 AM UTC
6+
workflow_dispatch: # Allows manual trigger from GitHub UI
77

8-
# jobs:
9-
# run-bot:
10-
# runs-on: ubuntu-latest
11-
# timeout-minutes: 15 # Prevent hanging jobs
12-
# # if: github.ref == 'refs/heads/main' # Only run on main branch
8+
jobs:
9+
run-bot:
10+
runs-on: ubuntu-latest
11+
timeout-minutes: 15 # Prevent hanging jobs
12+
# if: github.ref == 'refs/heads/main' # Only run on main branch
1313

14-
# steps:
15-
# - name: Checkout repository
16-
# uses: actions/checkout@v4
14+
steps:
15+
- name: Checkout repository
16+
uses: actions/checkout@v4
1717

18-
# - name: Setup Python
19-
# uses: actions/setup-python@v5
20-
# with:
21-
# python-version: '3.11'
18+
- name: Setup Python
19+
uses: actions/setup-python@v5
20+
with:
21+
python-version: '3.11'
2222

23-
# - name: Cache pip dependencies
24-
# uses: actions/cache@v4
25-
# with:
26-
# path: ~/.cache/pip
27-
# key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
28-
# restore-keys: |
29-
# ${{ runner.os }}-pip-
23+
- name: Cache pip dependencies
24+
uses: actions/cache@v4
25+
with:
26+
path: ~/.cache/pip
27+
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
28+
restore-keys: |
29+
${{ runner.os }}-pip-
3030
31-
# - name: Install dependencies
32-
# run: |
33-
# python -m pip install --upgrade pip
34-
# pip install -r requirements.txt
31+
- name: Install dependencies
32+
run: |
33+
python -m pip install --upgrade pip
34+
pip install -r requirements.txt
3535
36-
# - name: Verify installation
37-
# run: |
38-
# python --version
39-
# pip list
36+
- name: Verify installation
37+
run: |
38+
python --version
39+
pip list
4040
41-
# - name: Run the bot
42-
# run: |
43-
# python src/run.py
44-
# env:
45-
# # Twitter/X API credentials
46-
# BEARER_TOKEN: ${{ secrets.BEARER_TOKEN }}
47-
# CONSUMER_KEY: ${{ secrets.CONSUMER_KEY }}
48-
# CONSUMER_SECRET: ${{ secrets.CONSUMER_SECRET }}
49-
# ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}
50-
# ACCESS_TOKEN_SECRET: ${{ secrets.ACCESS_TOKEN_SECRET }}
41+
- name: Run the bot
42+
run: |
43+
python src/run.py
44+
env:
45+
# Twitter/X API credentials
46+
BEARER_TOKEN: ${{ secrets.BEARER_TOKEN }}
47+
CONSUMER_KEY: ${{ secrets.CONSUMER_KEY }}
48+
CONSUMER_SECRET: ${{ secrets.CONSUMER_SECRET }}
49+
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}
50+
ACCESS_TOKEN_SECRET: ${{ secrets.ACCESS_TOKEN_SECRET }}
5151

52-
# # Bot configuration
53-
# BASE_URL: ${{ secrets.BASE_URL }}
54-
# FORMAT: ${{ secrets.FORMAT }}
55-
# ORDER: ${{ secrets.ORDER }}
52+
# Bot configuration
53+
BASE_URL: ${{ secrets.BASE_URL }}
54+
FORMAT: ${{ secrets.FORMAT }}
55+
ORDER: ${{ secrets.ORDER }}
5656

57-
# # Optional: Uncomment if needed
58-
# # LOG_LEVEL: ${{ secrets.LOG_LEVEL }}
59-
# # LOG_FILE: ${{ secrets.LOG_FILE }}
60-
# # OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
61-
# # META_API_KEY: ${{ secrets.META_API_KEY }}
57+
# Optional: Uncomment if needed
58+
# LOG_LEVEL: ${{ secrets.LOG_LEVEL }}
59+
# LOG_FILE: ${{ secrets.LOG_FILE }}
60+
# OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
61+
# META_API_KEY: ${{ secrets.META_API_KEY }}
6262

63-
# # - name: Upload logs on failure
64-
# # if: failure()
65-
# # uses: actions/upload-artifact@v4
66-
# # with:
67-
# # name: bot-logs-${{ github.run_number }}
68-
# # path: |
69-
# # logs/
70-
# # *.log
71-
# # retention-days: 7
63+
# - name: Upload logs on failure
64+
# if: failure()
65+
# uses: actions/upload-artifact@v4
66+
# with:
67+
# name: bot-logs-${{ github.run_number }}
68+
# path: |
69+
# logs/
70+
# *.log
71+
# retention-days: 7
7272

73-
# # - name: Report status
74-
# # if: always()
75-
# # run: |
76-
# # if [ ${{ job.status }} == 'success' ]; then
77-
# # echo " Bot ran successfully at $(date)"
78-
# # else
79-
# # echo "Bot failed at $(date)"
80-
# # fi
73+
# - name: Report status
74+
# if: always()
75+
# run: |
76+
# if [ ${{ job.status }} == 'success' ]; then
77+
# echo " Bot ran successfully at $(date)"
78+
# else
79+
# echo "Bot failed at $(date)"
80+
# fi

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,4 +164,5 @@ cython_debug/
164164
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
165165
#.idea/
166166
src/ratelimit.py
167-
src/play.py
167+
src/play.py
168+
*.mp4

src/output.mp4

-24 KB
Binary file not shown.

src/test.mp4

-9.73 KB
Binary file not shown.

src/test2.mp4

-32.6 KB
Binary file not shown.

src/test3.mp4

-33 KB
Binary file not shown.

0 commit comments

Comments
 (0)