-
Notifications
You must be signed in to change notification settings - Fork 0
45 lines (35 loc) · 1.18 KB
/
update-quote.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
name: GitHub Self-Updating Stoic Quote
on:
schedule:
- cron: "0 0 * * *" # Runs daily at midnight
workflow_dispatch: # Allows manual triggering
permissions:
contents: write # Grant write permissions
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
jobs:
update-quote:
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.11" # or your preferred Python version
- name: Install dependencies
run: |
pip install --upgrade pip
pip install -r requirements.txt
- name: Run script to update README and files
run: python src/main.py --skip-api
- name: Configure Git
run: |
git config --global user.name "Jan Müller"
git config --global user.email "[email protected]"
- name: Commit and Push changes
run: |
now=$(date)
git add .
git commit -m "Auto-update Stoic Quote on $now" || echo "No changes to commit"
git push