Deploy hooks for cron jobs

Now that there’s an extensive API that includes deploys, I’ve been able to script up a solution to this. I’ve got the following command being executed for each of my cron jobs (as well as standard web/worker services, to be consistent rather than mixing it with deploy hooks):

curl --request POST \
     --url "https://api.render.com/v1/services/$SERVICE_ID/deploys" \
     --header "Accept: application/json" \
     --header "Authorization: Bearer $RENDER_API_KEY" \
     --header "Content-Type: application/json" \
     --write-out '%{http_code}' \
     --silent \
     --output /dev/null

(I’m keeping the output to just the status code, to avoid any secrets being output within my CI builds.)

1 Like