DEV Community

Cover image for Version and automate your dev.to publishing with GitHub Actions
Rémy 🤖
Rémy 🤖

Posted on • Updated on • Originally published at github.com

Version and automate your dev.to publishing with GitHub Actions

I love publishing on dev.to, yet there is a very big problem related to doing this: the web editor is not really dev-friendly since it doesn't allow you to version your content. There is also the constant fear of doing something wrong and losing an article that you wrote within the browser because of stupid computer crash or other kinds of CTRL+Q disasters.

Yet, faced with a challenge, what do devs do? They dev!

First things first, I've created a GitHub repo to manage all my upcoming Markdown files. Now I've got a place where to store my articles but how do I get them online?

Apparently the hot new thing is GitHub actions. So I created one in my repo! The GitHub interface is surprisingly intuitive for doing so. I'm absolutely no expert on the matter since I wrote my first action ever about 5 minutes ago, but it's fairly easy to use since that same action published this very article!

In order to be able to publish using GitHub actions, you need some kind of script. I couldn't find anybody who did that (but maybe did I search not enough?) so I created my own tool. Let me introduce DEV-CLI! 🎉 You'll find all the details in the README. You can of course use it right now to publish your Markdown, with or without GitHub actions 😇

I must say that this was a fun evening project. It's still completely experimental and I'd love feedback from other people doing the same thing — or not doing this if they have alternative workflows!

Top comments (5)

Collapse
 
scriptautomate profile image
Derek Ardolf • Edited

Thank you for making this. I have used Jekyll and Hugo static website generator frameworks that use Markdown for the blog formatting. I'll be testing how easy your tool makes integrating a GitHub Action to duplicate posts onto this platform.

Collapse
 
lepinekong profile image
lepinekong

Great, I may publish again on dev.to in the future ;)

Collapse
 
bak3y profile image
Bak3y

Super cool, I'm going to pivot to this publishing method ASAP.

Collapse
 
dev_ganesh profile image
Ganesh Kumar T K

Woah! Gonna try this ✌😃

Collapse
 
saurabhdaware profile image
Saurabh Daware 🌻

So cool! I love CLIs 🌻