Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
dev.toの記事もGitHubで管理してみた
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
YouYou
May 14, 2022
Technology
0
2.3k
dev.toの記事もGitHubで管理してみた
詳細ブログ↓
https://zenn.dev/yuta28/articles/dev-github-vscode
YouYou
May 14, 2022
Tweet
Share
More Decks by YouYou
See All by YouYou
AWSマネコンに複数のアカウントで入れるようになりました
yuhta28
2
270
今インフラ技術をイチから学び直すなら
yuhta28
1
270
AWSに詳しくない人でも始められるコスト最適化ガイド
yuhta28
3
640
Datadog外形監視基盤をEC2から ECSへ移行してみた
yuhta28
0
1.7k
アウトプット頑張ったら企業からLT登壇の依頼がきた話
yuhta28
1
1.8k
小さなことから始めるAWSコスト最適入門
yuhta28
1
1.3k
Datadogのコストも監視しよう
yuhta28
1
1k
Rcloneを使った定期的なストレージ同期
yuhta28
0
800
Pulumiを触ってみよう
yuhta28
1
2.6k
Other Decks in Technology
See All in Technology
1,000 にも届く AWS Organizations 組織のポリシー運用をちゃんとしたい、という話
kazzpapa3
0
140
M&A 後の統合をどう進めるか ─ ナレッジワーク × Poetics が実践した組織とシステムの融合
kworkdev
PRO
1
500
20260208_第66回 コンピュータビジョン勉強会
keiichiito1978
0
190
今日から始めるAmazon Bedrock AgentCore
har1101
4
420
FinTech SREのAWSサービス活用/Leveraging AWS Services in FinTech SRE
maaaato
0
130
広告の効果検証を題材にした因果推論の精度検証について
zozotech
PRO
0
210
登壇駆動学習のすすめ — CfPのネタの見つけ方と書くときに意識していること
bicstone
3
130
OCI Database Management サービス詳細
oracle4engineer
PRO
1
7.4k
SREじゃなかった僕らがenablingを通じて「SRE実践者」になるまでのリアル / SRE Kaigi 2026
aeonpeople
6
2.5k
Ruby版 JSXのRuxが気になる
sansantech
PRO
0
170
ECS障害を例に学ぶ、インシデント対応に備えたAIエージェントの育て方 / How to develop AI agents for incident response with ECS outage
iselegant
2
250
GitHub Issue Templates + Coding Agentで簡単みんなでIaC/Easy IaC for Everyone with GitHub Issue Templates + Coding Agent
aeonpeople
1
260
Featured
See All Featured
Build The Right Thing And Hit Your Dates
maggiecrowley
39
3k
How to Align SEO within the Product Triangle To Get Buy-In & Support - #RIMC
aleyda
1
1.4k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
49
9.9k
Applied NLP in the Age of Generative AI
inesmontani
PRO
4
2.1k
The Curious Case for Waylosing
cassininazir
0
240
HU Berlin: Industrial-Strength Natural Language Processing with spaCy and Prodigy
inesmontani
PRO
0
230
Git: the NoSQL Database
bkeepers
PRO
432
66k
30 Presentation Tips
portentint
PRO
1
220
It's Worth the Effort
3n
188
29k
Building Experiences: Design Systems, User Experience, and Full Site Editing
marktimemedia
0
410
Deep Space Network (abreviated)
tonyrice
0
64
Why Your Marketing Sucks and What You Can Do About It - Sophie Logan
marketingsoph
0
77
Transcript
dev.toの記事もGitHubで管理し てみた 1
Name:ユータ Occupation:SRE Twitter:@Y0u281 (オーでなくゼロです) ブログ:https://zenn.dev/yuta28 自己紹介 Twitter 2
目次 • 背景 • dev.toについて • dev.to管理用テンプレートリポジトリ • dev.toとGitHubとの連携 •
まとめ 3
背景 • Zennでブログ執筆中 ◦ GitHub Actionsを使って記事の自動投稿を実現 • dev.toでも同じように自動投稿を実現したい • すでに実践している人がいたので参考にしてみた
詳しくはこちら↓ GitHub ActionsでZennブログの 校正を自動化してみた 4
dev.toについて • 英語版Qiitaみたいなもの • 爆速であることで有名 ◦ 阿部寛さんのHPとどちらが速いか比較されたこともある • スマホアプリ版もある DEV
is a community of software developers getting together to help one another out. The software industry relies on collaboration and networked learning. We provide a place for that to happen. Aboutページより引用 5
dev.to管理用テンプレートリポジトリ 以下のリポジトリをコピーしてもらえたら皆さんもdev.toの記事をGitHubで管理できま す。 https://github.com/Yuhta28/dev-to-blog-template 6
DEV Community APIキー生成 GitHubにセットするAPIキー DEV API (beta) | Forem Docs
APIはベータ版なのか若干動作不安 7
GitHub Actions用の変数セット 先ほど生成したAPIキーをセット 8
GitHub Actionsワークフロー設定 deploy: # 長いので記事投稿部分のみ抜粋 name: Deploy if: github.ref == 'refs/heads/main'
&& github.event_name == 'push' runs-on: ubuntu-latest steps: - name: Checkout Repo uses: actions/checkout@master - name: Install Dependencies uses: bahmutov/npm-install@v1 - name: Deploy to dev.to run: DEV_TO_GIT_TOKEN=${{ secrets.DEV_TO_GIT_TOKEN }} yarn run dev-to-git Yarnパッケージ ↑参照 dev-to-gitにAPIキーを渡す 9
記事の初期作成 dev.toのAPIリクエストで作成する curl -X POST -H "Content-Type: application/json" \ -H
"api-key: API_KEY" \ -d \ '{"article":{"title":"Template","body_markdown":"Body","published":false,"tags":["tag1", "tag2"]}}' https://dev.to/api/articles 環境変数でセット 10 Goで作った
記事の初期作成 ドラフト記事作成 この記事のIDを取得する 11
記事IDの取得 curl -H "api-key: API_KEY" https://dev.to/api/articles/me/(un)published | \ jq '.[].id'
プログラミング言語でも取得できますが、一部の言語では取得できませんでした。 例:Python dev-to-git.json 12
記事の校正 簡単な誤字脱字はtextlintと reviewdogでCI時に自動検知 13
記事のデプロイ 14
記事のデプロイ 15
まとめ • ブログもGitHubで管理 • 好きなエディターで記事を書こう • GitHub Actionsはいいぞ! 16
ありがとうございました より詳しい内容は以下のブログで↓ dev.toの記事もGitHubで管理してみた (zenn.dev) 17