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 e025fba
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/calibreapp-image-optimizer.yml
@@ -1,4 +1,4 @@
name: Compress Images
name: "[Cleanup] Compress Images"
on:
pull_request:
# Run Image Actions when JPG, JPEG, PNG or WebP files are added or changed.
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/github-pages-deploy.yml
@@ -1,4 +1,4 @@
name: GitHub Pages Deploy
name: "[Deploy] GitHub Pages"

on:
workflow_dispatch:
Expand Down
31 changes: 31 additions & 0 deletions .github/workflows/post-to-dev-to.yml
@@ -0,0 +1,31 @@
name: "[Publish] Dev.to Article"
# 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
uses: spencerlepine/publish-devto@v1.0.0
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
11 changes: 8 additions & 3 deletions .github/workflows/post-to-medium.yml
@@ -1,4 +1,4 @@
name: Medium Article Publish
name: "[Publish] Medium Article"
# uses: https://github.com/philips-software/post-to-medium-action

on:
Expand All @@ -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] # Medium
tags: 'Git,Terminal,Commands' # Dev.to (Max 3)
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 e025fba

Please sign in to comment.