Hi 👋,
I'm thinking about to have my blog posts as markdown files in a git repo, which are automatically are published to dev.to. Also a change at the markdown file should trigger a change to the dev.to blog post.
What are the best ways?
I found following approaches on GitHub:
sinedied / publish-devto
📮 GitHub Action to publish markdown files on dev.to platform, with assets hosted on GitHub.
📮 publish-devto
GitHub Action to publish markdown files as articles on dev.to platform, with assets hosted on GitHub.
Usage
See action.yml.
steps
- uses: actions/checkout@v4
- name: Publish articles on dev.to
uses: sinedied/publish-devto@v2
with:
# Your dev.to personal API key to publish and update articles.
# See https://docs.dev.to/api/#section/Authentication/api_key
devto_key: ${{ secrets.DEVTO_TOKEN }}
# Your GitHub personal access token, used to create commits for updated files.
# If you have a protected branch, you need to use a personal access token
# with the 'repo' permission.
# See https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token
github_token: ${{ secrets.GITHUB_TOKEN }}
# (Optional) The files to publish. Default is "posts/**/*.md"
files: 'posts/**/*.md'
# (Optional) The git branch to use. Default is 'main'.
branch: main
# (Optional) Use conventional commit messages. Default is false.
# See https://www.conventionalcommits.org.
conventional_commits: true
# (Optional) Do not make actual changes on
…tylerauerbeck / publish-to-dev.to-action
A GitHub Action that allows you to publish an article to Dev.to
publish-to-dev.to-action
Disclaimer
This is a work in progress. Currently it provides initial functionality to publish\update an article to the Dev.to blogging platform.
What does this action do?
This action takes a file that provides a listing of files that you are interested in (i.e. files that were changed in a pull request, provided by a previous action or step) and then scrapes that list for markdown files. Once it has filtered for just markdown files, it then assembles an appropriate json request and sends it to Dev.to. As long as everything is successful, the action will let you know that the article has been pushed to dev.to. Otherwise it will let you know that the file has failed and it will fail that run of the action.
Assumptions
This action assumes that you are using frontmatter in your markdown to provide a number of required fields. This was done as…
And also some on dev.to:
Automate your DEV Posts using GitHub Actions
beeman 🐝 ・ Jul 5 '20
Writing a dev.to blog post with VSCode
Tim Deschryver ・ Jun 12 '19
Manage your dev.to blog posts from a GIT repo and use continuous deployment to auto publish/update them
Maxime ・ Jul 7 '19
Update 18.08.2020
Publish DEV articles from a Git repo, with Github + Pipedream
Dylan J. Sather ・ Jun 10 '20
Thanks.
Top comments (2)
I’d love to know as well. Do you have any opinions about the two solutions you listed?
I had a quick look at publish-devto. Unfortunately, I couldn't get it to work.
If there is no other recommendation, I'll check publish-to-dev.to-action next 😄