DEV is a great community for developer content. If you have articles that you don’t want live all at once, how can you publish on a schedule automatically? In this article, let’s use GitHub Actions to get your content online on your timeline.

GitHub Actions is a way to run code on GitHub’s servers. The service is effectively a Continuous Integration (CI) service from GitHub. To use GitHub Actions, we create a workflow in a Git repository. That workflow contains all the steps to run the code we care about.

To publish to DEV, we can:

  1. Use a workflow…
  2. To read a publishing schedule we create…
  3. And check the current time…
  4. And publish an article to DEV if the publish date is in the past.

Before we get to the workflow, let’s look at the code that will run.

Creating a schedule

The first step in this whole process is to create a publishing schedule that our script can read. Minimally, that requires two types of data from a list of articles:

  1. The ID of the article
  2. The datetime to publish at

So, where do we get those things?

The first datum comes from your actual unpublished articles. From my observation, the DEV website does not expose this ID in an obvious fashion from the UI, but it’s not hard to find.

From your unpublished article page, view the source of the page. In both Firefox and Chrome, you can get to this by selecting “View Page Source” when you right click somewhere on the page.

View Page Source on Firefox

On the source page, search for article-id with Ctrl+F (or Cmd+F on macOS). You should find a number value like 168727.

#github #schedule #dev

Publish to DEV automatically with GitHub Actions
2.05 GEEK