-
Notifications
You must be signed in to change notification settings - Fork 0
29 lines (25 loc) · 855 Bytes
/
cron.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
name: Daily Voice Sync
on:
schedule:
- cron: '0 10 * * *' # runs daily at 5am EST
workflow_dispatch: # allows manual triggering
jobs:
sync-voices:
runs-on: ubuntu-latest
steps:
- name: Sync Voices
env:
CRON_ACTION_SECRET: ${{ secrets.CRON_ACTION_SECRET }}
ELEVENLABS_API_KEY: ${{ secrets.ELEVENLABS_API_KEY }}
run: |
RESPONSE=$(curl -s -L -w "%{http_code}" -H "Authorization: Bearer $CRON_ACTION_SECRET" \
-X GET "https://www.npspeak.com/api/cron")
STATUS_CODE=${RESPONSE: -3}
BODY=${RESPONSE::-3}
echo "Response body: $BODY"
if [ "$STATUS_CODE" -ne 200 ]; then
echo "Sync Voices failed with status code $STATUS_CODE"
exit 1
else
echo "Sync Voices executed successfully."
fi