34
loading...
This website collects cookies to deliver better user experience
curl -X POST -d {} https://api.netlify.com/build_hooks/$NETLIFY_BUILD_HOOK_TOKEN
Important: Ensure you keep NETLIFY_BUILD_HOOK_TOKEN
secret, otherwise anyone can call your build and potentially cause you to go over your build quota.
.github/workflows
, you could create:name: Scheduled build
on:
schedule:
- cron: '00 15 * * *'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Trigger our build webhook on Netlify
run: curl -s -X POST "https://api.netlify.com/build_hooks/${TOKEN}"
env:
TOKEN: ${{ secrets.NETLIFY_BUILD_HOOK_TOKEN }}
build_hook
token in a secret on Github.Github Actions are disabled on projects after 60 days if there is no activity on the repository, meaning bye bye scheduled builds.
.circleci
config.yml
config.yml
with something like the following (you can use a different image if you wish). This will build every day at 3PM.version: 2
defaults: &defaults
machine:
image: circleci/classic:201710-02
steps:
- run: curl -X POST -d {} https://api.netlify.com/build_hooks/$NETLIFY_BUILD_HOOK_TOKEN
jobs:
docker:
<<: *defaults
workflows:
version: 2
autobuild:
triggers:
- schedule:
cron: "0 14 * * *"
filters:
branches:
only:
- main
jobs:
- docker
NETLIFY_BUILD_HOOK_TOKEN
will need to be set as an environment variable, in a similar way to Github, in the setting of CircleCI for your project.