Skip to content

Daily Voice Sync

Daily Voice Sync #4

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 -H "Authorization: Bearer $CRON_ACTION_SECRET" \
-X GET "https://npspeak.com/api/cron")
echo "Response body: $RESPONSE"
STATUS_CODE=$(curl -s -o /dev/null -w "%{http_code}" -L -H "Authorization: Bearer $CRON_ACTION_SECRET" \
-X GET "https://npspeak.com/api/cron")
if [ "$STATUS_CODE" -ne 200 ]; then
echo "Sync Voices failed with status code $STATUS_CODE"
exit 1
else
echo "Sync Voices executed successfully."
fi