GitHub Action to publish markdown files as articles on dev.to platform, with assets hosted on GitHub.
See action.yml.
steps:
- uses: actions/checkout@v7
- 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 token, used to create commits for updated files.
# For a personal access token, create a secret named GH_TOKEN because
# custom secret names cannot start with GITHUB_.
# The built-in secrets.GITHUB_TOKEN can also be used when it has
# contents: write permission and branch protection rules allow it.
# See https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token
github_token: ${{ secrets.GH_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 dev.to.
dry_run: falseYou can use this template repository as an example setup.
You can specify who you want to appear in the commits made by this action by adding these environment variables to the action:
env:
GIT_COMMITTER_NAME: your_name
GIT_COMMITTER_EMAIL: your@email.comThis github action delegates most of the work to the devto-cli push command.
You can find more information about how it works in the CLI readme.