I have a list of scheduled posts to be published on my blog every week. This is how I use Zapier to automatically trigger the deployment of my Hugo static site on Netlify every morning
I have a scheduled list of posts that I want to publish on my blog every week, and I try to keep a few days before that queue to make room when I can’t write or want to take a break.
I find that consistency is very important to maintain momentum. Since two months, I have posted every day from Monday to Saturday, and I want to do this in the future, because I really like it.
This is an amazing combination of tools and I am very satisfied with the blog setup.
Today, when I realized that I had exceeded the usual publishing time and did not publish the scheduled blog posts, I was hiking in the mountains.
Using Hugo, I can set a future release date and use
hugoCLI command, the post is not included in the generated HTML because it is a future post.
Netlify has a good concept of building a Hugo site on its server, so all I need to do is trigger a new deployment. Usually, when I push something to GitHub, it will be deployed-Netlify will automatically be alerted and the deployment will be completed in a minute or less.
In this case, I need to manually trigger the deployment on Netlify, so I log in with my iPhone and click "Trigger Deployment".
This operation rebuilt the static site using Hugo on the server side, and I just put the phone back in my pocket.
The blog post started 🎉 and I just tweeted on Twitter.
When I walked, I realized that I could automate all these things.
I just need to automatically trigger the deployment at 9 AM in some way every day. So I checked the Netlify interface to see if they have any automatic timers for repeated deployments. There is no such feature, but they have a WebHook endpoint.
Therefore, I have been looking for content that can be configured to be posted to WebHook every day. enterZapier.
Zapier is a fully automated tool.
Googling I found oneZap sends WebHook POST requests every day, And this is exactly what I need.
Now, on Netlify, I just created a WebHook URL
This gave me a custom URL to call:
I just pasted the URL on Zapier and set it to make an empty POST request to my Netlify hook:
The manually triggered Zap deployment test worked:
I am very happy now! I just need to create content and push it to GitHub on the scheduled date, so I don’t have to worry about deploying it! 🌈🎉👨🏼💻
More service tutorials:
- How to start using Firebase hosting
- Tutorial for hosting a static site on Netlify
- Code insertion program and formatter for web developers
- Automatic trigger deployment on Netlify
- Glitch, a great developer platform
- Airtable API for developers
- How to authenticate through any Google API
- Zeit Now tutorial
- Netlify Lambda function tutorial
- How to use Firebase Firestore as a database
- How can I fix the trailing slash in Netlify rewrite
- How to access query parameters in Netlify function
- How to use environment variables in Netlify functions
- How to use npm package in Netlify function
- How to create the first VPS on DigitalOcean