# Publish Drafts on a Schedule

**URL:** <https://talk.jekyllrb.com/t/publish-drafts-on-a-schedule/4415>\
**Category:** Share\
**Created:** [May 12, 2020, 3:29pm UTC](https://talk.jekyllrb.com/t/publish-drafts-on-a-schedule/4415 "2020-05-12T15:29:02Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![anon75751883](https://avatars.discourse-cdn.com/v4/letter/a/0ea827/32.png) [@anon75751883](https://talk.jekyllrb.com/u/anon75751883)\
**Post date:** [May 12, 2020, 3:29pm UTC](https://talk.jekyllrb.com/t/publish-drafts-on-a-schedule/4415/1 "2020-05-12T15:29:03Z")

</div>

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](https://bit.ly/2YT95Rq). 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](https://bit.ly/2SVrWHG).

I welcome comments or suggestions. Just leave them here, in the post comments, or on Twitter (same handle as here).

Thanks,  
Dave

---

<div class="post-metadata">

**Author:** ![MichaelCurrin](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/michaelcurrin/32/2340_2.png) [@MichaelCurrin](https://talk.jekyllrb.com/u/MichaelCurrin)\
**Post date:** [May 13, 2020, 7:14pm UTC](https://talk.jekyllrb.com/t/publish-drafts-on-a-schedule/4415/2 "2020-05-13T19:14:27Z")

</div>

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.

> **[MichaelCurrin/jekyll-actions-quickstart](https://github.com/MichaelCurrin/jekyll-actions-quickstart)**
>
> How to setup Github Pages + Actions for use with Jekyll 4 - MichaelCurrin/jekyll-actions-quickstart

---

<div class="post-metadata">

**Author:** ![MichaelCurrin](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/michaelcurrin/32/2340_2.png) [@MichaelCurrin](https://talk.jekyllrb.com/u/MichaelCurrin)\
**Post date:** [May 13, 2020, 10:09pm UTC](https://talk.jekyllrb.com/t/publish-drafts-on-a-schedule/4415/4 "2020-05-13T22:09:04Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![MichaelCurrin](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/michaelcurrin/32/2340_2.png) [@MichaelCurrin](https://talk.jekyllrb.com/u/MichaelCurrin)\
**Post date:** [May 13, 2020, 10:12pm UTC](https://talk.jekyllrb.com/t/publish-drafts-on-a-schedule/4415/5 "2020-05-13T22:12:33Z")

</div>

I thought GH actions and docker run linux only and not powershell

This page says Windows works on actions [https://github.com/features/actions](https://github.com/features/actions)

---

<div class="post-metadata">

**Author:** ![MichaelCurrin](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/michaelcurrin/32/2340_2.png) [@MichaelCurrin](https://talk.jekyllrb.com/u/MichaelCurrin)\
**Post date:** [May 13, 2020, 11:01pm UTC](https://talk.jekyllrb.com/t/publish-drafts-on-a-schedule/4415/7 "2020-05-13T23:01:13Z")

</div>

Oh thanks for info. I thought it was Windows only

---

<div class="post-metadata">

**Author:** ![highinthefssky](https://avatars.discourse-cdn.com/v4/letter/h/a3d4f5/32.png) [@highinthefssky](https://talk.jekyllrb.com/u/highinthefssky)\
**Post date:** [September 14, 2020, 6:57pm UTC](https://talk.jekyllrb.com/t/publish-drafts-on-a-schedule/4415/8 "2020-09-14T18:57:13Z")

</div>

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?
