Skip to content

Commit

Permalink
Setup devto-cli
Browse files Browse the repository at this point in the history
  • Loading branch information
mziyut committed Aug 25, 2023
1 parent fcd19cc commit 3a7c02a
Show file tree
Hide file tree
Showing 9 changed files with 939 additions and 10 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/devto_publish_articles.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Dev.to - publish articles

on:
push:
branches:
- main
paths:
- 'devto/**'
- '.github/workflows/devto_publish_articles.yml'
workflow_dispatch:

permissions:
contents: write
pull-requests: write

defaults:
run:
shell: bash

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: false

jobs:
publish_articles:
runs-on: ubuntu-latest
timeout-minutes: 5
environment:
name: devto
url: https://dev.to/mziyut
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
cache: 'yarn'
- run: yarn install
- run: yarn workspace devto run dev push
env:
DEVTO_TOKEN: ${{ secrets.DEVTO_TOKEN }}
DEVTO_REPO: mziyut/articles
- run: yarn workspace devto format:fix
- uses: peter-evans/create-pull-request@v5
with:
commit-message: Publish articles
delete-branch: true
title: Publish articles
committer: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
reviewers: mziyut
branch: create-pull-request/patch-publish-articles-devto
add-paths: |
devto/posts/*
labels: |
articles
automerge
devto
44 changes: 44 additions & 0 deletions .github/workflows/devto_pull_articles.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Dev.to - pull articles

on:
schedule:
- cron: '*/20 * * * *'
push:
paths:
- '.github/workflows/devto_pull_articles.yml'
workflow_dispatch:

permissions:
contents: write
pull-requests: write

jobs:
pull_articles:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v3
with:
ref: main
- uses: actions/setup-node@v3
with:
cache: 'yarn'
- run: yarn install
- run: yarn workspace devto run dev init -p
env:
DEVTO_TOKEN: ${{ secrets.DEVTO_TOKEN }}
DEVTO_REPO: mziyut/articles
- run: yarn workspace devto format:fix
- uses: peter-evans/create-pull-request@v5
with:
commit-message: Pull articles
delete-branch: true
title: Pull articles
committer: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
reviewers: mziyut
branch: create-pull-request/patch-pull-articles-devto
add-paths: |
devto/posts/*
labels: |
articles
devto
1 change: 1 addition & 0 deletions .github/workflows/qiita_publish_articles.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,4 @@ jobs:
labels: |
articles
automerge
qiita
1 change: 1 addition & 0 deletions .github/workflows/qiita_pull_articles.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,4 @@ jobs:
qiita/public/*
labels: |
articles
qiita
19 changes: 19 additions & 0 deletions devto/.textlintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"plugins": {},
"filters": {
"comments": true
},
"rules": {
"@textlint-ja/no-synonyms": {
"allows": [],
"prleferWords": [],
"alrllowAlphabet": true,
"alrllowNumber": true,
"alrllowLexeme": true
},
"aws-service-name": true,
"no-mixed-zenkaku-and-hankaku-alphabet": true,
"no-todo": true,
"period-in-list-item": true
}
}
33 changes: 33 additions & 0 deletions devto/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"name": "devto",
"version": "0.1.0",
"description": "mziyut's devto",
"main": "index.js",
"scripts": {
"format": "run-s prettier",
"format:fix": "run-s prettier:fix",
"prettier": "prettier --check .",
"prettier:fix": "prettier --write .",
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "Yuta Mizui <[email protected]>",
"license": "MIT",
"dependencies": {
"@sinedied/devto-cli": "^1.3.0"
},
"devDependencies": {
"npm-run-all": "^4.1.5",
"prettier": "^3.0.2",
"textlint": "^13.3.3",
"textlint-filter-rule-comments": "^1.2.2",
"textlint-formatter-codecov": "^1.0.2",
"textlint-rule-aws-service-name": "^1.4.0",
"textlint-rule-no-mixed-zenkaku-and-hankaku-alphabet": "^1.0.1",
"textlint-rule-no-todo": "^2.0.1",
"textlint-rule-period-in-list-item": "^1.0.1"
},
"prettier": {
"singleQuote": true
}
}
Loading

0 comments on commit 3a7c02a

Please sign in to comment.