Skip to content

Commit

Permalink
Add automatic build triggering
Browse files Browse the repository at this point in the history
Use GitHub Actions to trigger a Netlify deploy for the primary branch,
twice per day.
  • Loading branch information
sftim committed Dec 23, 2020
1 parent ec80275 commit f5dc913
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/netlify-periodic-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
name: Scheduled Netlify site build
on:
schedule: # Build twice daily: shortly after midnight and noon (UTC)
# Offset is to be nice to the build service
- cron: '4 0,12 * * *'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Trigger build on Netlify
env:
TOKEN: ${{ secrets.NETLIFY_BUILD_HOOK_KEY }}
run: >-
curl -s -H "Accept: application/json" -H "Content-Type: application/json" -X POST -d "{}" "https://api.netlify.com/build_hooks/${TOKEN}"

0 comments on commit f5dc913

Please sign in to comment.