Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/eduardoboucas/scheduled-netlify-deploys

Trigger Netlify deploys on a schedule
https://github.com/eduardoboucas/scheduled-netlify-deploys

cron functions netlify scheduled

Last synced: 3 months ago
JSON representation

Trigger Netlify deploys on a schedule

Awesome Lists containing this project

README

        

# Scheduled Netlify Deploys

[![Deploy to Netlify](https://www.netlify.com/img/deploy/button.svg)](https://app.netlify.com/start/deploy?repository=https://github.com/eduardoboucas/scheduled-function-template)

You can make use of [Scheduled Functions](https://ntl.fyi/sched-func) and [Build Hooks](https://docs.netlify.com/configure-builds/build-hooks/) to automatically deploy your Netlify site on a recurring schedule.

Here's how:

1. Follow the [Scheduled Functions documentation](https://ntl.fyi/sched-func) to enable the experimental feature for your new site

2. Go to the site settings, [create a new Build hook](https://docs.netlify.com/configure-builds/build-hooks/), and copy the URL

Creating a build hook

3. Create an environment variable named `BUILD_HOOK_URL` with the URL from the previous step

Setting an environment variable

4. Copy the [example function](https://github.com/eduardoboucas/scheduled-function-template/blob/main/netlify/functions/scheduled.ts) into your `netlify/functions` directory
- You can change the frequency from `@hourly` to `@daily`, `@weekly`, or any [valid cron expression](https://crontab.guru/)

5. Deploy your site and wait for the builds to start showing

Build logs