Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
GitHub ActionsでZennブログの校正を自動化してみた
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
YouYou
April 04, 2021
Technology
3.6k
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
GitHub ActionsでZennブログの校正を自動化してみた
詳細ブログ⇓
https://zenn.dev/yuta28/articles/blog-lint-ci-reviewdog
YouYou
April 04, 2021
More Decks by YouYou
See All by YouYou
AWSマネコンに複数のアカウントで入れるようになりました
yuhta28
2
310
今インフラ技術をイチから学び直すなら
yuhta28
1
310
AWSに詳しくない人でも始められるコスト最適化ガイド
yuhta28
3
690
Datadog外形監視基盤をEC2から ECSへ移行してみた
yuhta28
0
1.9k
アウトプット頑張ったら企業からLT登壇の依頼がきた話
yuhta28
1
1.9k
小さなことから始めるAWSコスト最適入門
yuhta28
1
1.5k
Datadogのコストも監視しよう
yuhta28
1
1.1k
Rcloneを使った定期的なストレージ同期
yuhta28
0
880
Pulumiを触ってみよう
yuhta28
1
2.8k
Other Decks in Technology
See All in Technology
Tab5をRubyで動くパソコンにする
kishima
2
280
「図書館」という名前のままでいいのか -Code4Lib JAPANカンファレンス2026 アンカンファレンス報告- / Code4Lib JAPAN Conference 2026: Unconference Report
ykiyota
0
150
module Synths; end
asonas
1
130
【視聴者参加型!】AWSセキュリティアンチパターンクイズ
syoshie
1
490
「重なり」は迎える側がつくる ― 人もAIエージェントも歓迎するプロダクトエンジニアリング ―
go0517go
PRO
0
280
From Vanilla Kubernetes to a Batteries-Included Platform: Developer Experience at 1,300+ Clusters
yosshi_
0
680
作り直せるコードは迅速に 作り直せないDBは慎重に - AI時代のプロダクトエンジニアが「判断の不可逆性」で開発速度を変える話
kinosuke01
0
290
OpenTelemetry eBPF Instrumentationの舞台裏 / Behind the Scenes of OpenTelemetry eBPF Instrumentation
ymotongpoo
3
910
synctest時代のhttptest Go 1.27で変わるHTTPサーバテストの裏側 / go conference2026 synctest and httptest
budougumi0617
1
1.7k
SQL文一行も書けない人事がCortexもろもろを使って人事業務を楽にしてみる
ponponmikankan
1
210
GuardDuty 検知対応を DevOps Agent で効率化しようとしている話 / GuardDuty Investigations with DevOps Agent
masahirokawahara
1
350
研究開発部の紹介 / Sansan R&D Profile
sansan33
PRO
4
25k
Featured
See All Featured
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
360
30k
HU Berlin: Industrial-Strength Natural Language Processing with spaCy and Prodigy
inesmontani
PRO
0
690
Sam Torres - BigQuery for SEOs
techseoconnect
PRO
0
540
Neural Spatial Audio Processing for Sound Field Analysis and Control
skoyamalab
0
480
JAMstack: Web Apps at Ludicrous Speed - All Things Open 2022
reverentgeek
1
590
Breaking role norms: Why Content Design is so much more than writing copy - Taylor Woolridge
uxyall
1
400
Building Flexible Design Systems
yeseniaperezcruz
330
41k
Become a Pro
speakerdeck
PRO
31
6.2k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
16k
The Curious Case for Waylosing
cassininazir
1
500
Tell your own story through comics
letsgokoyo
1
1.1k
How to Build an AI Search Optimization Roadmap - Criteria and Steps to Take #SEOIRL
aleyda
1
2.2k
Transcript
GitHub Actionsで ブログの校正を自動化してみた
Name:ユータ Occupation:インフラエンジニア Twitter:@Y0u281 (オーでなくゼロです) ブログ:https://zenn.dev/yuta28 → 普段触るもの:AWS Ansible Linux Mint
自己紹介 Twitter
目次 • 背景 • 技術スタック紹介 ◦ textlint ◦ reviewdog •
実装 • 工夫ポイント • まとめ
背景 • ZennブログをGitHub連携することができるようになった☆ ◦ Zenn個人開発の限界に挑んだ話 - devsumi 2021 詳しくは開発者のプレゼン 👀 •
CIツールを導入する事で自動化が可能に👏 ◦ リポジトリを更新する度にドキュメントの校正 ◦ イイ感じのブログ執筆
textlint • mdファイルやプレーンテキスト向けのLinterツール • npm install textlint `textlint-rurle` → ルールもインストール •
デフォルトルールが存在せず、自分でルールを決めなければならない • .textlintrc にルールを記述 https://textlint.github.io/
textlint # .textlintrc { "rules": { "preset-smarthr": { "sentence-length": false
}, "prh": { "rulePaths": [ "dict/smarthr-prh-basic.yml", "dict/smarthr-prh-tech-word.yml" ] } } } ルール • textlint-rule-preset-smarthr • textlint-rule-prh 参照 よりよい文書を書くための校正ツール「 textlint」の SmartHR用ルールプリセットを公開しました! |SmartHRオープン社内報
reviewdog • GitHubにlinterツールで検知した指摘事項をレビューコメントに投稿 • Goで書かれたOSS • Circle CIやGitHub Actionsなど複数のCIサービスと連携可能 https://github.com/reviewdog/reviewdog
実装 jobs: reviewdog-github-check: name: reviewdog (github-check) runs-on: ubuntu-latest steps: #reviewdogのアクション
- uses: reviewdog/action-setup@v1 with: reviewdog_version: latest #textlintを動かすための nodeアクション - uses: actions/setup-node@v2 - name: Install textlint run: 'npm install --save-dev textlint-rule-preset-smarthr textlint-rule-prh' - name: Install dependent module run: npm install - name: Execute textlint for ブログ記事 run: | npx textlint -f checkstyle "articles/*.md" >> .textlint.log - name: Run reviewdog # textlintで文章上のミスがあった場合のみ、 reviewdogを実行させるようにする if: failure() env: REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | cat .textlint.log | reviewdog -f=checkstyle -name="textlint" -reporter="github-pr-review" 1) reviewdog,nodeのアクションを起動 2) textlintのインストール 3) textlintを記事に対して実行 4) 何かしらの記載ミスが有った場合のみtextlintの出力結果を reviewdogに渡してGitHubにレビューコメントを投稿
デモ イメージ図
工夫ポイント • キャッシュを使って高速化 ◦ GitHub Actionの公式にactions/cache • stepが失敗するとキャッシュしてくれない • stepが終了してもキャッシュしてくれるアク
ションを使う https://github.com/pat-s/always-upload-c ache #stepsが失敗(文章の乱れ)した場合でもcacheを取得するようにする uses: pat-s/
[email protected]
env: cache-name: cache-node-modules with: path: ~/.npm key: node-${{ hashFiles('**/package-lock.json') }} restore-keys: | node-
工夫ポイント • キャッシュ前(初回実行) 50秒 • キャッシュ取得後(2回目以降) 29秒
まとめ
ありがとうございました より詳しい内容は以下のブログで ↓ GitHub ActionsでZennブログの校 正を自動化してみた