Setting up Scheduled Posts

less than 1 minute read

:information_source: Have a challenge with any of this? Let us know and we’ll help!

By default, this blog has a GitHub Action that will run to publish every hour. That way, you can create a post for the future, and when the build runs and that post is no longer in the future, it will be published.

You’ll need to take one of two actions. If you don’t want scheduled posts, delete scheduled-posts.yml from the .github directory.

If you do want scheduled posts:

  • You’ll need to generate a token called PAGES_ACCESS_TOKEN and save it, as described here. The general summary is:
    • Go to your GitHub tokens settings
    • Click the button to create a new token, and give it a name like “Scheduled Posts” or similar.
    • For the permissions, specify public_repo.
    • Copy the Access token for use in the next step.
  • Add the secret for GitHub actions
    • Go into the settings of your GitHub repository.
    • Select Secrets --> Actions from the left-hand menu.
    • Click the New Repository Secret button
    • Name the secret PAGES_ACCESS_TOKEN and paste the value in.
  • Update the repository value in the scheduled-posts.yml file – instead of excellalabs/blog-in-a-box, use your username and repository name.

Updated:

Comments