Scheduling builds and deploys with Netlify

Hey y’all :wave:t2:

For what it’s worth, and as eluded to by @dmotan, a GitHub Action can work really well for kicking off your Netlify builds. I added this Action as part of my site’s same repository, so it shouldn’t ever be stale enough to stop running (haven’t looked into that, but just wanted to throw it out there just-in-case), but I use:

To check both internal and external links from my site, so if any external links die off, I want to know about it in a timely fashion. Just make sure you have a ./.github/ directory in the root of your repo, then a /workflows/ directory inside of that.

# ./.github/workflows/main.yml

name: Trigger Netlify Build
on:
  schedule:
    - cron: '0 0 * * *' # Once a day
jobs:
  build:
    name: Request Netlify Webhook
    runs-on: ubuntu-latest
    steps:
      - name: POST to Build Hook
        run: curl -X POST -d {} https://api.netlify.com/build_hooks/<YOUR_HOOK_ID>

Then, as a certain well known Netlifier would say, It’s done!

Hope that helps :slight_smile:


Jon

4 Likes