Skip to content

Commit

Permalink
feat: workflow to publish articles to Dev.to
Browse files Browse the repository at this point in the history
  • Loading branch information
spencerlepine committed Apr 3, 2024
1 parent 845d704 commit 1223cb0
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 3 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/post-to-dev-to.yml
@@ -0,0 +1,30 @@
name: Dev.to Article Publish
# uses: https://github.com/sinedied/publish-devto

on:
workflow_dispatch:
inputs:
folder:
description: 'Name of article folder: blog/<FOLDER_NAME>/index.md'
required: true
type: string

jobs:
post-to-dev-to:
name: Post to Dev.to
runs-on: ubuntu-latest
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 }}
github_token: ${{ secrets.GITHUB_TOKEN }}
# (Optional) The files to publish. Default is "posts/**/*.md"
# files: 'blog/**/*.md'
files: "blog/${{ inputs.folder }}/*.md"
# (Optional) The git branch to use. Default is 'main'.
branch: main
conventional_commits: false
9 changes: 7 additions & 2 deletions .github/workflows/post-to-medium.yml
Expand Up @@ -12,6 +12,11 @@ on:
description: 'Article Title'
required: true
type: string
tags:
description: 'List of tags (eg. "tag1,tag2")'
required: true
type: string


jobs:
post-to-medium:
Expand All @@ -27,7 +32,7 @@ jobs:
file: "${{ inputs.file }}"
content_format: "markdown"
notify_followers: "false"
tags: "test,tag"
tags: "${{ inputs.tags }}"
title: ${{ inputs.title }}
license: "all-rights-reserved"
publish_status: "draft"
publish_status: "public"
7 changes: 6 additions & 1 deletion blog/creating-custom-git-commands/index.md
@@ -1,9 +1,14 @@
---
title: Creating Custom Git Commands
slug: creating-custom-git-commands
tags: [Git, Scripts, Terminal, Commands, GitHub]
# tags: [Git, Scripts, Terminal, Commands, GitHub]
# tags: 'Git,Scripts,Terminal,Commands,GitHub'
authors: [spencerlepine]
date: 2021-08-15
cover_image: ./thumbnail.jpg
description: Creating custom Git commands to help automate git workflow.
published: true
canonical_url: null
---

![Blog Post Thumbnail](./thumbnail.jpg)
Expand Down

0 comments on commit 1223cb0

Please sign in to comment.