Hey Dev.to π
Just wanted to share a quick setup Iβm using to publish posts directly to Dev.to using GitHub Actions.
Basically, I write my blog in Markdown, commit it to GitHub, and the post goes live automatically. No manual copy-paste, no forgetting to publish. Super simple, but saves time and keeps everything version-controlled.
This post itself was published that way.
Why bother?
I got tired of switching between editors, formatting things twice, or forgetting what I published where. So I wrote a small Python script that pushes the post to Dev.to, and wrapped it in a GitHub Action. Now itβs just:
git push
β¦and boom π₯ β post is live.
How it works
You just need:
A publish_to_devto.py script (uses the Dev.to API)
Your blog posts in a /posts folder
A GitHub Action that runs the script on push
Your Dev.to API key stored as a GitHub secret
Thatβs it.
Folder layout
Hereβs what the repo looks like:
.
βββ posts/
β βββ hello-devto.md
βββ publish_to_devto.py
βββ .github/workflows/publish.yml
βββ requirements.txt
One-time setup
Add your Dev.to API key as a GitHub secret (e.g., DEVTO_API_KEY)
Write your blog in Markdown
Push to GitHub
Thatβs it β your post will show up on your Dev.to profile.
This is the first one Iβve published using the flow β just testing it out, and so far it works.
Will share the code and full setup in the next post if anyoneβs interested.
Cheers π
Top comments (0)