Schedule Netlify Builds With Github Actions
Publish date: Jan 6, 2022
Last updated: Feb 9, 2023
Last updated: Feb 9, 2023
Steps
-
Create a POST request build hook in your Netlify dashboard: Site settings > Build & deploy > Continuous deployment > Build hooks.
-
In your GitHub repo, create a main.yml file in a .github/workflows directory.
-
Create a cron schedule.
name: Schedule Netlify Build
on:
schedule:
# “At 20:00 on every day-of-week from Monday through Friday.”
- cron: '0 20 * * 1-5'
jobs:
build:
name: Build Hook
runs-on: ubuntu-latest
steps:
- name: Curl request
run: curl -X POST -d {} BUILD_HOOK_URL