Scheduling builds and deploys with Netlify

Just to provide another solution to this, it is easy to use GitHub Actions to schedule builds.

You only need to add 1 file to your GitHub repo: .github/workflows/main.yml

# .github/workflows/main.yml

name: Trigger Netlify Build
on:
  schedule:
    # Run at 0815 daily
    - cron: '15 8 * * *'
jobs:
  build:
    name: Request Netlify Webhook
    runs-on: ubuntu-latest
    steps:
      - name: Curl request
        run: curl -X POST -d {} YOUR_BUILD_HOOK

Replace YOUR_BUILD_HOOK with your Netlify Build hook url.
You can use crontab.guru to easily generate your cron schedule.
A cron schedule of 0 */3 * * * would run every third hour, to answer the original question :point_up:

I wrote a blog post about this and created an example GitHub repo with this workflow if anyone is interested!

10 Likes