Skip to content
An example of triggering a Netlify build using Github Actions Scheduled Events
JavaScript
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github/workflows
.gitignore
README.md
build.js
netlify.toml
package.json

README.md

Trigger Netlify builds on a schedule using Github Actions

  1. Add a Build hook to your site using the Netlify Dashboard

    Settings > Build & Deploy > Continuous Deployment > Build hooks

  2. Create a .github/workflows/main.yml file in your Github repo, replacing YOUR_BUILD_HOOK with the build hook you just created.

    name: Trigger Netlify Build
    on:
      schedule:
        - cron: '*/15 * * * *' # every 15 mins
    jobs:
      build:
        name: Request Netlify Webhook
        runs-on: ubuntu-latest
        steps:
          - name: Curl request
            run: curl -X POST -d {} YOUR_BUILD_HOOK
  3. Adjust the cron settings to determine how often the build will be triggered.
    15 8 * * * would run every day at 0815
    0 0,12 * * * would run at midday and midnight every day
    crontab guru can help you generate the correct cron syntax.
    See the Github Actions Docs for more info.

  4. Open the Actions tab in you Github repo to watch the workflow complete. 🎉

You can’t perform that action at this time.