Skip to content

Daily Voice Sync

Daily Voice Sync #19

Workflow file for this run

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