I’ve been using Jekyll and a third-party theme since August 2018 to publish my blog using GitHub Pages. I truly enjoy the fact that it’s a static site and is built using easy-to-understand markdown. I’m no Jekyll Pro, but I have modified the theme a bit and created my own data file for a particular page.
A few months ago, I was asked to participate in a blog event and needed to schedule the publication of a couple posts. At the time, I didn’t have spare time to make that happen, so I dutifully pushed my drafts at odd hours and lost a bit of sleep.
I did, however, discover a GitHub Action called Jekyll Publish Drafts. Over the last few days, I finally spent the time to get this working and have written a post about it.
If you use GitHub Pages for your Jekyll site and need to schedule the publication of a post at a specific time, check out my post Publish a Post for a Jekyll Site on a Schedule.
I welcome comments or suggestions. Just leave them here, in the post comments, or on Twitter (same handle as here).
Thanks,
Dave
1 Like
Thanks for sharing.
I discovered the cron option recently so I want to use it for nightly or weekly runs.
The article looks well laid out and detailed.
Maybe I am missing something - what was the reason for using the Drafts flow and action? Rather than a generic one.
My understanding is that you can put a post in _posts folder and it will not be published unless the --future flag is used (such as for local testing). Then you don’t need to more or rename posts. You rebuild every day and then the future dated posts then becomes current and so appears.
I have a demo here which uses and references the Jekyll Actions action (similar to the one you used but more generic than draft-related). Perhaps this would work too for your case.
1 Like
The one I recommended rebuilds on a push, or pull request or schedule - depending what you configure in workflow for on. It it is independent of posts and dates
My demo builds on every push to master. There is no posts directory
I thought GH actions and docker run linux only and not powershell
This page says Windows works on actions https://github.com/features/actions
Oh thanks for info. I thought it was Windows only
1 Like
I tried to use the plugin by following the blogpost in the article. The issues I am experiencing is that if there is no file in the directory the workflow fails. Is there a way overwriting this behavior?