GitHub Action
TheActionDev
Write dev.to articles with GitHub Action.
Start writing dev.to articles with TheActionDev-template
As of May 28, 2022, v1 and v2 has been fully sunset and no longer functions
Due to the deprecation of the underlying utility functions, the TheActionDev GitHub Action
has released v3
which will use the js-yaml library for parsing front-matter in articles.
I will be restricting any updates to the v1
and v2
Actions to security updates and hotfixes.
The v3
uploader has a few breaking changes for users
- Multiple tags have not been assigned as string with colon(,) or have been deprecated. Instead of use YAML Array List to assign it.
TheActionDev is Github Action that allows you to write & maintain dev.to articles
without touching the dev.to
UI. This action is initiated in #ActionsHackathon using DEV API.
This action is scan your Github Repository based on directory
input and finds articles based
on the Jekyll front matter in markdown
files.
- You'll first need to create a YAML file to describe the workflow in your project (e.g. .github/workflows/TheActionDev.yaml).
- Generate dev.to
apiKey
by following dev.to authentication docs - Add your
apiKey
to GitHub Secret by following Github's creating and storing encrypted secrets doc
name: TheActionDev Sync
on:
push:
branches:
- main # your default branch
jobs:
operations:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v2
- name: Sycing Article to dev.to
uses: ful1e5/TheActionDev@v3
with:
api-key: ${{ secrets.DEVTO_API_KEY }} # Store your 'api-key' in Github Secret
directory: ./articles # Your article directory
ignore: Development.md, Production.md # Markdown file you wan't to ignore. Multple files separated by ,(comma)
DEV API Key. Set inside Github Secret.
Relative path to your articles files (*.md) directory
The file you want to ignore by this action. This feature is implemented by @actions/glob, So you also provide glob pattern with it.
for example, I want ignore all articles inside foo
sub-directory, The action input look like this 👇.
.....
- name: Sycing Article to dev.to
uses: ful1e5/TheActionDev@v3
with:
api-key: ${{ secrets.DEVTO_API_KEY }}
directory: ./articles
- ignore: foo/bar.md, foo/hello.md
+ ignore: foo/**.md
.....
Listed files ignored globally by TheActionDev.
- README.md
- CONTRIBUTING.md
- CODE_OF_CONDUCT.md
- CHANGELOG.md
- Pull Request Templates
- Issue Templates
Original Docs @ DEV Editor Guide
Custom variables set for each post, located between the triple-dashed lines in your editor. Here is a list of possibilities:
- title: the title of your article
- published: boolean that determines whether or not your article is published
- description: description area in Twitter cards and open graph cards
- tags: max of four tags, needs to be YAML Array List
- canonical_url: link for the canonical version of the content
- cover_image: cover image for post, accepts a URL.(The best size is 1000 x 420.)
- series: post series name.
tag | value | required |
---|---|---|
title | null |
yes |
published | false |
no |
description | null |
no |
tags | [] |
no |
canonical_url | null |
no |
cover_image | null |
no |
series | null |
no |
- Use YAML to write and format posts front-matter.
- Use Markdown to write and format posts body.
- You can use Liquid tags to add rich content such as Tweets, YouTube videos, etc.
---
title: TheActionDev
description: Hello World
published: false
tags:
- typescript
- javascript
- github
series: TheActionDev
---
First Post with **TheActionDev**
{% github ful1e5/TheActionDev %}
Check docs/DEVELOPMENT.md
- DEV Docs
- vscode-devto extension for
vscode
- typescript-action
You can create a issue, I will help you.
Check CONTRIBUTING.md, any suggestions for features and contributions to the continuing code
masterelopment can be made via the issue tracker or code contributions via a Fork
& Pull requests
.